Python Developer track

Python interview questions and answers

Python is the most asked-for language in engineering jobs. Python interviews start with the basics and climb to generators, async code and memory. Then you solve a coding problem.

Start a free mock interview

Questions

Interview questions and answers.

Real questions from this track, from easier to harder, with what a good answer covers. In the mock interview, each one comes with follow-ups based on what you say.

  1. Data types

    What is the difference between a list and a tuple in Python?

    A good answer covers that a list can be changed after it is made while a tuple cannot.

  2. Functions

    What goes wrong when a function has a list as its default argument?

    A good answer covers that the default is created once, when the function is defined, not on each call.

  3. Syntax

    What is a list comprehension, and when should you not use one?

    A good answer covers that a comprehension builds a list from a loop and an optional filter in one expression.

  4. Errors

    How do you handle errors in Python?

    A good answer covers that try and except catch an exception so the program can respond to it.

  5. Resources

    What does a with statement do?

    A good answer covers that with uses a context manager to set something up and always clean it up.

  6. Tooling

    Why use a virtual environment, and how do you manage dependencies?

    A good answer covers that a virtual environment keeps each project's packages apart.

  7. Data types

    How does a Python dictionary work, and when do you use one?

    A good answer covers that a dictionary maps keys to values and finds a key in about constant time.

  8. Data types

    What is the difference between is and == in Python?

    A good answer covers that == compares values while is checks whether two names point to the same object.

  9. Iteration

    What is a generator, and why would you use one?

    A good answer covers that a generator yields values one at a time instead of building a whole list.

  10. Concurrency

    What is the GIL, and what does it mean for threads?

    A good answer covers that in standard CPython only one thread runs Python code at a time.

  11. Typing

    What do type hints do in Python?

    A good answer covers that type hints describe what a function takes and returns.

  12. Classes

    What are dataclasses, and when do you use them?

    A good answer covers that @dataclass writes __init__, __repr__ and __eq__ from the fields.

  13. Functions

    What is a decorator, and how would you write one?

    A good answer covers that a decorator takes a function and returns a new one that wraps it.

  14. Concurrency

    How does asyncio work?

    A good answer covers that an event loop runs coroutines and switches between them when they await.

  15. Data types

    What is the difference between a shallow copy and a deep copy?

    A good answer covers that a shallow copy makes a new outer object but shares the objects inside it.

  16. Iteration

    What makes an object iterable in Python?

    A good answer covers that a for loop calls iter on the object and then next until StopIteration.

  17. Internals

    How does CPython manage memory?

    A good answer covers that each object counts its references and is freed when the count reaches zero.

  18. Testing

    How do you write good tests in Python?

    A good answer covers that pytest tests are plain functions with assert, and fixtures give them what they need.

  19. Performance

    A Python function is too slow. How do you make it faster?

    A good answer covers that you profile first, with cProfile or a sampling profiler, to find the slow part.

  20. Classes

    How do properties work, and what is a descriptor?

    A good answer covers that property turns method calls into attribute access, with getters and setters.

  21. Classes

    How does Python decide which method runs with multiple inheritance?

    A good answer covers that the method resolution order lists classes in a fixed sequence, from C3 linearization.

  22. Concurrency

    How do you choose between threads, processes and asyncio?

    A good answer covers that asyncio fits many waiting network calls with async-ready libraries.

  23. Tooling

    How do you package and publish a Python library?

    A good answer covers that pyproject.toml declares the name, version, dependencies and build backend.

  24. Architecture

    How would you structure a large Python codebase for several teams?

    A good answer covers that code is split into packages by domain with clear public modules.

  25. Concurrency

    An asyncio service slows down under load. How do you find the cause?

    A good answer covers that a blocking call in a coroutine stalls the whole loop, and debug mode reports slow steps.

  26. Performance

    How would you process a dataset too large to fit in memory with Python?

    A good answer covers that you stream it in chunks with generators instead of loading it all.

  27. Typing

    How would you add type checking to a large untyped Python codebase?

    A good answer covers that you start with the checker in a lenient mode and tighten module by module.

  28. Tooling

    How would you move a large service to a newer Python version?

    A good answer covers that dependencies must support the new version first.

  29. Security

    How would you protect a Python codebase from risky dependencies?

    A good answer covers that dependencies are locked with hashes so installs cannot change silently.

  30. Architecture

    How would you set standards for Python across many teams?

    A good answer covers that a shared template sets tooling, layout and CI so every project starts the same.

  31. Performance

    When would you move part of a Python system to another language?

    A good answer covers that you first prove where the time goes and what it costs.

  32. Architecture

    How would you make a fleet of Python services reliable in production?

    A good answer covers that every service has timeouts, retries with backoff and health checks.

What it covers

Topics.

  • Concurrency
  • Data types
  • Functions
  • Tooling
  • Iteration
  • Classes
  • Performance
  • Architecture
  • Resources
  • Typing
  • Internals
  • Syntax

How it works

How the mock interview runs.

  1. Concept questions that start simple and get harder.

  2. Follow-ups on every answer, so you explain the why.

  3. One coding challenge in a live editor.

Your report scores technical correctness, problem-solving & tradeoffs, communication clarity, with quotes from your answers as proof.

Questions.

What Python questions come up in interviews?

Expect lists versus tuples and how dictionaries work. A classic is the bug with a list as a default argument. Senior roles add generators, decorators, async code and the GIL.

How does an Orin mock interview work?

You talk with Orin by voice, like a video call. It asks questions, listens and asks follow-ups based on what you said. Coding happens in a live editor and design on a live whiteboard. After the interview you get a report with quotes from your answers, what cost you points and what to practice next.

Is it free?

Your first interview is free: a 15-minute round with a short coding exercise. No card needed.

Practice the real thing.

A python developer mock interview by voice, with follow-ups and feedback you can use. First interview free.

Start free interview