Python interviews focus on data structures, mutability, OOP, stdlib fluency, and practical trade-offs with JavaScript, Java, and C#. Be ready to write clean functions on a whiteboard or shared editor.
Must-know topics
- Lists, dicts, sets, comprehensions, and copying semantics
- Functions, decorators, context managers, and exceptions
- Classes, MRO, dunder methods, and dataclasses
- GIL, threading vs multiprocessing, and async teaser
- venv, pip, pytest, type hints, and file/JSON I/O
Important interview questions and answers
- Q: Explain list vs tuple.
A: Lists are mutable sequences; tuples are immutable and hashable when elements are—use tuples for fixed records. - Q: What is the GIL?
A: Global Interpreter Lock—CPython allows one thread to execute bytecode at a time; use multiprocessing for CPU-bound parallelism. - Q: When not use Python?
A: Hard latency-sensitive systems, some mobile game engines, or teams standardized on JVM-only stacks without Python ops.
Self-check
- List three Python topics you will review before interviews.
- How does shallow copy differ from deep copy?
Tip: Be ready to explain mutability, GIL, list/dict complexity, and EAFP vs LBYL—common screen topics.
Interview prep
- Must-know topics?
Mutability, list/dict operations, GIL, OOP basics, exceptions, comprehensions, venv/pip, and clean functions.
- Explain GIL briefly?
CPython mutex allowing one thread to execute bytecode at a time—IO-bound threading still helps; CPU-bound use multiprocessing.