用户名: 密码: 忘记密码? 注册

Python自我评定

作者:  时间: 2010-11-27
下面是一些国外网站上摘录的自测和面试题目。比较全面,可以用来测定一下自己对python的理解深度。

  1. Do they know a tuple/list/dict when they see it?
  2. When to use list vs. tuple vs. dictionary vs. set?
  3. Can they use list comprehensions (and know when not to abuse them?)
  4. Can they use tuple unpacking for assignment?
  5. String building. Do they use “+=” or do they build a list and use .join() to recombine them efficiently?
  6. Truth-value testing questions and observations (do they write “if x == True” or do they just write “if x”)?
  7. Basic file-processing (iterating over a file’s lines)
  8. Basic understanding of exception handling

  9. Questions about the standard library (”do you know if there’s a standard library for doing X?”, or “in which library would you find [common functionality Y]?”) Most of these are related to the more common libraries such as os/os.path/sys/re/itertools
  10. Questions about iterators/generators
  11. Questions about map/reduce/sum/etc family of functions
  12. Questions about “special” methods (__foo__)
  13. Can they manipulate functions as first-class objects (Python makes it easy, but do they know how)
  14. More detailed questions about the std. libraries (such as datetime/email/csv/zipfile/networking/optparse/unittest)
  15. Questions about testing (unittests/doctests)
  16. Questions about docstrings vs. comments, and the “Why” of them
  17. More detailed questions about regular expressions
  18. Questions about mutability
  19. Keyword/list parameters and unpacked keyword arguments
  20. Questions about popular 3rd-party toolkits (BeautifulSoup, pyparsing…mostly if they know about them and when to use them, not so much about implementation details)
  21. Questions about monkey-patching
  22. Questions about PDB
  23. Questions about properties vs. getters/setters
  24. Questions about classmethods
  25. Questions about scope/name-resolution
  26. Use of lambda
  27. Decorators added in which version?
  28. SQL-capable DB in which version?
  29. The difference between “class Foo” and “class Foo(object)”
  30. Questions from “import this” about pythonic code
  31. What do they know about various Python web frameworks (knowing a few names is usually good enough, though knowledge about the frameworks is a nice plus) such as Django, TurboGears, Zope, etc.
  32. What do they know about various Python GUI frameworks and the pros/cons of them (tkinter, wx, pykde, etc)
  33. Where do they go with Python related questions (c.l.p, google, google-groups, etc)