Code Monkey home page Code Monkey logo

python-interview-questions's Introduction

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?

python-interview-questions's People

Contributors

sigmavirus24 avatar szeitlin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.