Python interviews for senior roles focus on internals, not syntax. Expect deep questions about the GIL and its implications for concurrency, how CPython manages memory with reference counting and garbage collection, and the descriptor protocol that powers properties and classmethods.
These 28 questions target the gaps that separate mid-level Python developers from senior ones: metaclasses, import machinery, async/await internals, and the subtle differences between generators and coroutines. If you can explain these concepts to an interviewer, you’re demonstrating genuine depth.
The Global Interpreter Lock (GIL) is a mutex inside CPython that ensures only one thread executes Python bytecode at any given moment.
Read full answer →Both ThreadPoolExecutor and ProcessPoolExecutor are part of Python's concurrent.futures module and provide a high-level interface for running callables asynchronously using a pool of workers.
Read full answer →A decorator in Python is a callable -- typically a function -- that takes a function as an argument and returns a new callable.
Read full answer →A generator in Python is a special type of iterator.
Read full answer →A context manager is an object that defines a setup and teardown protocol for a block of code, ensuring cleanup happens reliably regardless of whether the block exits normally or via an exception.
Read full answer →LEGB is Python's name resolution order: when the interpreter encounters a variable name, it searches scopes in this sequence: Local → Enclosing → Global → Built-in.
Read full answer →Python's Method Resolution Order (MRO) determines which class's method is called when a name is looked up in an inheritance hierarchy.
Read full answer →Python's `@property` decorator turns a method into a descriptor that's accessed like an attribute — `obj.name` instead of `obj.name()`.
Read full answer →By default, every Python instance stores its attributes in a per-instance dictionary (`__dict__`).
Read full answer →These three decorators are distinct tools that change how a method receives arguments and how it is invoked — understanding them requires understanding Python's descriptor protocol.
Read full answer →In Python, `is` and `==` are fundamentally different operations that are often confused because they coincidentally produce the same result in common cases.
Read full answer →In Python, default argument values are evaluated **once** when the `def` statement is executed — not each time the function is called.
Read full answer →Copying in Python has three distinct levels: assignment, shallow copy, and deep copy.
Read full answer →Object creation in Python is a two-step process mediated by `__new__` and `__init__`.
Read full answer →CPython uses two complementary mechanisms for memory management: **reference counting** as the primary strategy and a **cyclic garbage collector** as a fallback for cyclic references that reference counting cannot handle.
Read full answer →A decorator is a function that takes a function and returns a modified function.
Read full answer →`__getattribute__` and `__getattr__` are both attribute access hooks, but they differ fundamentally in when they are called and how dangerous they are to override.
Read full answer →`functools.partial` is a higher-order function that creates a new callable with some arguments of an existing function pre-filled (partially applied).
Read full answer →`defaultdict` and `OrderedDict` are both subclasses of `dict` in `collections`, each adding a specialized behavior on top of the standard dictionary.
Read full answer →Duck typing is a programming style where an object's suitability for a use is determined by the presence of the required methods and attributes, not by its class hierarchy.
Read full answer →Monkey patching is the practice of dynamically modifying or replacing attributes, methods, or modules at runtime — without altering the original source code.
Read full answer →A mixin is a class that provides specific, reusable behavior intended to be 'mixed in' to other classes via multiple inheritance, without being instantiated directly or expressing an 'is-a' relationship.
Read full answer →Profiling is the process of measuring where a program spends its time, so you can direct optimization efforts at the actual bottleneck rather than guessing.
Read full answer →The itertools module provides building blocks for efficient looping in Python, operating lazily so they never materialize full sequences in memory.
Read full answer →**Fixtures** are functions decorated with `@pytest.fixture` that pytest injects into test functions by parameter name.
Read full answer →**Code coverage** quantifies how much of your source code is exercised by a test suite.
Read full answer →**PyPI** (Python Package Index) is the public registry of Python packages.
Read full answer →A **module** in Python is any single `.py` file.
Read full answer →Focus on understanding concepts deeply enough to explain them in your own words. For each topic, practice articulating the trade-offs and real-world applications — interviewers care about practical judgment, not textbook definitions.
Take a free AI-graded assessment across multiple domains. No signup required.
Start Free Assessment