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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
What do type hints do in Python?
A good answer covers that type hints describe what a function takes and returns.
What are dataclasses, and when do you use them?
A good answer covers that @dataclass writes __init__, __repr__ and __eq__ from the fields.
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.
How does asyncio work?
A good answer covers that an event loop runs coroutines and switches between them when they await.
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.
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.
How does CPython manage memory?
A good answer covers that each object counts its references and is freed when the count reaches zero.
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.
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.
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.
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.
How do you choose between threads, processes and asyncio?
A good answer covers that asyncio fits many waiting network calls with async-ready libraries.
How do you package and publish a Python library?
A good answer covers that pyproject.toml declares the name, version, dependencies and build backend.
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.
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.
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.
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.
How would you move a large service to a newer Python version?
A good answer covers that dependencies must support the new version first.
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.
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.
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.
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.
How it works
How the mock interview runs.
Concept questions that start simple and get harder.
Follow-ups on every answer, so you explain the why.
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