Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sigmavirus24/python-interview-questions
A listing of questions that could potentially be asked for a python job listing
https://github.com/sigmavirus24/python-interview-questions
Last synced: about 2 months ago
JSON representation
A listing of questions that could potentially be asked for a python job listing
- Host: GitHub
- URL: https://github.com/sigmavirus24/python-interview-questions
- Owner: sigmavirus24
- Archived: true
- Created: 2014-08-13T02:32:38.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-10T11:07:36.000Z (over 9 years ago)
- Last Synced: 2024-01-24T04:14:59.415Z (11 months ago)
- Size: 189 KB
- Stars: 189
- Watchers: 17
- Forks: 58
- Open Issues: 1
-
Metadata Files:
- Readme: README.mkd
Awesome Lists containing this project
- Awesome-GitHub-Repo - python-interview-questions - Python 高赞面试题。[<img src="https://tva1.sinaimg.cn/large/008i3skNly1gxlhtmg11mj305k05k746.jpg" alt="微信" width="18px" height="18px" />]() (学习资源 / Python资源)
README
# Python Interview Questions
This repository contains a number of Python interview questions that can be
used when vetting potential candidates. It is not advised to use every one of
these questions for the same candidate.## Descriptive/Vocabulary Questions
1. What is Python?
1. Describe some features of Python.
1. How does Python execute code?
1. What are some built-in types in Python?
1. What are bindings, i.e., what does it mean for a value to be bound to a
variable?## Usage Questions
1. How do you create a list?
1. How do you create a dictionary?
1. What is a list comprehension? Why would you use one?
1. What is a generator? What can it be used for?
1. What is inheritance?
1. What happens if you have an error in an __init__ statement?
1. What happens in python if you try to divide by zero?
1. How can you improve the following code?
```python
import stringi = 0
for letter in string.letters:
print("The letter at index %i is %s" % (i, letter))
i = i + 1
```Bonus points for mentioning `enumerate` and use of `str.format`.
1. How can you return multiple values from a function/method?
## Strategic Questions
1. What's the fastest way to swap the values bound to two variables?
1. What is the importance of reference counting?
1. Do functions (or methods) return something even if there isn't a `return`
statement? If so, what do they return?1. How do you reverse a list? Can you come up with at least three ways?
1. How would you merge two sorted lists? They can be any length, or empty.
1. How would you count the lines in a file? How would you do it if the file was too big to hold in memory?