搜索关键字:
- python interview question
- Python 面试问题
参考链接:
- http://www.ilian.io/python-interview-question-and-answers/
- http://xiaocong.github.io/blog/2013/06/16/python-interview-question-and-answer/
- http://www.toptal.com/python/interview-questions
- http://www.reddit.com/r/Python/comments/1knw7z/python_interview_questions
- =
- http://www.geekinterview.com/Interview-Questions/Programming/Python
- http://www.quora.com/What-are-good-Python-interview-questions
- http://www.careerride.com/python-interview-questions.aspx
参考问题列表:
- 字符串的处理和正则表达式。
- 如何操作json和xml数据。
- 参数是如何传递的?传值还是传引用?(How are arguments passed – by reference of by value?)
- 什么是列表和字典推导(list and dict comprehensions)?你能给个例子吗?
- 什么是 PEP 8?
- 如何计算列表里所有元素的和?如何计算列表里所有元素的乘积?
- 你能列出列表(list)和元组(tuple)的区别吗?举例子说明用法的不同。
- 你知道range和xrange的区别吗?
- 请说出一些 python2.x 与 python3.x 之间的区别。
- 什么是修饰器(Decorator)?你能说出它的用途吗?
- with语句及其用法?
- Package/Module的定义和区别,以及模块加载的原则。
- 如何进行Package/Module的打包和分发?
- 生成器(generator)的概念以及使用方式。
- 你常用的 built-in 类型和函数有哪些?好处在哪?
- 什么是 WSGI ?
- 元类编程(metaclass)的概念,以及如何使用?
##
- http://www.reddit.com/r/Python/comments/1knw7z/python_interview_questions
- http://www.reddit.com/r/Python/comments/dxvtv/favorite_python_interview_question/
- http://programmers.stackexchange.com/questions/21917/python-interview-questions
- http://ilian.i-n-i.org/python-interview-question-and-answers/
##
easy/intermediate #Python中的装饰器(decorator)是什么,有什么作用? What are Python decorators and how would you use them? #你如何解决项目中使用依赖于不同Python版本的第三方库的问题的? How would you setup many projects where each one uses different versions of Python and third party libraries? #PEP8是什么,你自己在编码时会考虑到其中的规范问题么? What is PEP8 and do you follow its guidelines when you're coding? #Python中的参数传递到底是值传递还是引用传递? How are arguments passed – by reference of by value? (easy, but not that easy, I'm not sure if I can answer this clearly) #列表推导式和字典推导式 Do you know what list and dict comprehensions are? Can you give an example? #用3种不同的方法取每一个列表中的第三个元素 Show me three different ways of fetching every third item in the list #列表和元组的不同之处在哪? Do you know what is the difference between lists and tuples? Can you give me an example for their usage? #Python2中range和xrange的不同之处 Do you know the difference between range and xrange? #Python2和Python3的不同之处有哪些? Tell me a few differences between Python 2.x and 3.x? #with语句的使用 The with statement and its usage. #如何避免重复引用? How to avoid cyclical imports without having to resort to imports in functions? #from xx import * 这样有什么不好? What's wrong with import all? #GIL的重要性 Why is the GIL important? (This actually puzzles me, don't know the answer) #什么是特殊方法,它们如何工作的,举例说明 What are "special" methods (<foo>), how they work, etc #你能像操作"first-class object"那样操作函数么? can you manipulate functions as first-class objects? #"class Foo" 和 "class Foo(object)" 的不同之处 the difference between "class Foo" and "class Foo(object)" tricky, smart ones #在Python中如何读取一个8G大小的文件? how to read a 8GB file in python? #你不喜欢Python中的什么特性/语法? what don't you like about Python? #如何独立将一个ascii码转换成整数而不使用内置方法或函数? can you convert ascii characters to an integer without using built in methods like string.atoi or int()? curious one subjective ones #你在Python编码时使用Tab还是空格? do you use tabs or spaces, which ones are better? Ok, so should I add something else or is the list comprehensive?
##
Python中module和package的不同之处
- http://stackoverflow.com/questions/7948494/whats-the-difference-between-a-python-module-and-a-python-package
- http://stackoverflow.com/questions/19198166/whats-the-difference-between-a-module-and-a-library-in-python
- http://programmers.stackexchange.com/questions/111871/module-vs-package
- http://www.quora.com/What-is-the-difference-between-a-python-module-package-And-when-to-use-which-one
Python中的WSGI是什么?
- https://www.python.org/dev/peps/pep-0333/
- http://wsgi.readthedocs.org/en/latest/
- http://blog.csdn.net/on_1y/article/details/18803563
- https://github.com/minixalpha/SourceLearning/tree/master/wsgiref-0.1.2
- http://blog.kenshinx.me/blog/wsgi-research/
- http://www.ibm.com/developerworks/library/wa-wsgi/
Python的元类编程
- http://blog.jobbole.com/21351/
- http://www.ibm.com/developerworks/cn/linux/l-pymeta/
- http://blog.csdn.net/gzlaiyonghao/article/details/3048947
- http://pycon.b0.upaiyun.com/ppt/shell909090-meta-class.html
- =
- http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/001386820064557c69858840b4c48d2b8411bc2ea9099ba000
- http://dnscai.com/blog/2013/05/08/python-meta-programming-auto-create-class/
Python中的修饰器(@decorator)
- #Python的修饰符详解http://coolshell.cn/articles/11265.html
- #在使用Python的修饰符时需要注意的地方http://blog.sina.com.cn/s/blog_967e337b01012bxb.html
对Python中 *args 和 **kwargs 的解释
搜索关键字:python *args **kwargs
- http://www.cnblogs.com/Blaxon/p/4520128.html
- http://pythontips.com/2013/08/04/args-and-kwargs-in-python-explained/
- http://stackoverflow.com/questions/287085/what-do-args-and-kwargs-mean
- http://stackoverflow.com/questions/3394835/args-and-kwargs
Python中参数是如何传递的?传值还是传引用?
回答:“都不是”,事实上 Python 里是传对象(a reference to an object)
搜索关键字:
python How are arguments passed
参考链接:
- http://stackoverflow.com/questions/986006/how-do-i-pass-a-variable-by-reference
- http://robertheaton.com/2014/02/09/pythons-pass-by-object-reference-as-explained-by-philip-k-dick/
- https://www.jeffknupp.com/blog/2012/11/13/is-python-callbyvalue-or-callbyreference-neither/
在Python中如何计算列表里所有元素的和?如何计算列表里所有元素的乘积?
#基本loop方式,sum函数方式,以及使用reduce函数 # the basic way s = 0 for x in range(10): s += x # the right way s = sum(range(10)) # the other way from operator import add s = reduce(add, range(10))
你能列出列表(list)和元组(tuple)的区别吗?举例子说明用法的不同。
搜索关键字:python difference between list and tuple
参考链接:
- http://stackoverflow.com/questions/626759/whats-the-difference-between-list-and-tuples
- http://www.quora.com/What-are-the-differences-between-tuples-and-lists-in-Python
- https://www.daniweb.com/software-development/python/threads/140142/list-vs-tuples
参考解答:
列表和元组是 Python 里最基本的两个数据类型:
首先,列表对象是可变的(mutable),但元组不是;
其次,元组可被哈希(hashable),例如可以用作字典对象的键(key);
至于例子,地图上的地理坐标可以用二元组表示,而地图上的路径可以用坐标点列表来表示。
但也并不是所有的 tuple 都是可被hash的,比如:包含了list等不可hash的内容的tuple就无法被hash
=EOF=
《 “Python中的一些面试问题小结” 》 有 10 条评论
5 个很好的 Python 面试题
https://segmentfault.com/a/1190000000618513
Python面试题汇总
http://www.selfrebuild.net/2015/08/25/python-interview-test/
一些针对软件开发人员的面试题
https://github.com/brettchalupa/developer-interview-questions
面试大全(Everything you need to know to get the job.)
https://github.com/kdn251/interviews
https://github.com/search?q=topic%3Ainterview&type=Repositories
https://github.com/search?q=topic%3Ainterview-questions&type=Repositories
https://github.com/search?q=topic%3Aalgorithm&type=Repositories
几道python面试题
http://www.hi-roy.com/2017/07/21/%E5%87%A0%E9%81%93python%E9%9D%A2%E8%AF%95%E9%A2%98/
`
生成斐波那契数列并取前10项
扩展一个列表,列表中的元素可能也包含列表
创建一个类,并输出某个属性。如果这个属性存在则输出值,否则输出这个属性名的字符串
简述py2和py3的区别
python的垃圾回收机制
python中多线程的方法,局限,以及有什么其他方式进行并发处理
简述epoll、select、poll三种模型
`
Python WSGI 初探
http://liaoph.com/python-wsgi/
`
WSGI 是什么
WSGI 标准简介
WSGI Server & Web 框架
Werkzeug
wsgiref
WSGI Server
`
http://wsgi.tutorial.codepoint.net/intro
https://ruslanspivak.com/lsbaws-part1/
详解Python元类
https://mp.weixin.qq.com/s/aSMdIfT5OwpjE0IhOcdegw
https://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python
https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/
`
什么是元类?
创建自己的元类
什么时候需要用元类?
`
Python 3新特性汇总(一)
https://zhuanlan.zhihu.com/p/33027947
https://github.com/arogozhnikov/python3_with_pleasure
从Python2迁移到Python3实战(一) – pyupgrade
https://www.dongwm.com/post/139/
如何编写快速且线程安全的Python代码
http://www.bugcode.cn/2019/05/22/python_thread_safe/
`
概述
GIL概览
协作式多任务
优先权式多任务
Python线程安全
并发提供更好的性能
并行
总结
`