GitXplorerGitXplorer
s

python-interview-questions

public
220 stars
57 forks
1 issues

Commits

List of commits on branch master.
Unverified
4cfe64a005452d49ada500ba2d07758f0267b06e

Update README.mkd

sszeitlin committed 10 years ago
Unverified
e38dc83aa53df0daf1f6de1d54ab68a8291fe954

Merge pull request #1 from szeitlin/master

sszeitlin committed 10 years ago
Unverified
892d18ad00df77a694f9f6f6cd83428a6a0b8f39

added a few more questions

sszeitlin committed 10 years ago
Unverified
88c4266842160c6e09908467e301e9a81d0fee6e

Add a couple more questions

ssigmavirus24 committed 10 years ago
Unverified
a4f4e3222e72183033c307405c24b46e418ddbec

Let markdown auto-number the questions for us

ssigmavirus24 committed 10 years ago
Unverified
d63d015154db93d3a37d2adc69db83b42edee07e

See if this fixes the formatting on GitHub

ssigmavirus24 committed 10 years ago

README

The README file for this repository.

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?

  2. Describe some features of Python.

  3. How does Python execute code?

  4. What are some built-in types in Python?

  5. 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?

  2. How do you create a dictionary?

  3. What is a list comprehension? Why would you use one?

  4. What is a generator? What can it be used for?

  5. What is inheritance?

  6. What happens if you have an error in an init statement?

  7. What happens in python if you try to divide by zero?

  8. How can you improve the following code?

    import string
    
    i = 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.

  9. 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?

  2. What is the importance of reference counting?

  3. Do functions (or methods) return something even if there isn't a return statement? If so, what do they return?

  4. How do you reverse a list? Can you come up with at least three ways?

  5. How would you merge two sorted lists? They can be any length, or empty.

  6. How would you count the lines in a file? How would you do it if the file was too big to hold in memory?