Python
Language internals and core semantics, the data model and class machinery, concurrency, testing, and idiomatic design.
Questions I use to pressure-test my understanding of Python beyond day-to-day usage — the object model, execution model, and the trade-offs behind common patterns.
Subtopics
- Language internals & the CPython runtimeSeniorLanguage vs implementation, bytecode compilation, what CPython stores per object, stack vs heap, shared methods, and what unpacking and swaps compile to.8 concepts
- Core semantics & gotchasMid / SeniorIdentity vs equality, name binding, closures, mutable defaults, copying, truthiness, and the small syntax features (walrus, match/case) whose semantics trip people up.8 concepts
- Numbers & numeric typesMid / SeniorArbitrary-precision int, IEEE 754 floats, Decimal vs Fraction, floor division, numeric hashing and promotion.7 concepts
- The data model & dundersSeniorDunder-method categories and object defaults, repr vs str, __call__/__format__/__del__/pickling hooks, __instancecheck__, and __dict__, vars, globals and __slots__.15 concepts
- Classes: MRO, super(), descriptors & metaclassesSeniorC3 linearization, what super() really is, __new__ vs __init__, type/object bootstrapping, the descriptor protocol and attribute lookup, property internals, and cooperative multiple inheritance.21 concepts
- Overloading, dispatch & bindingSeniorWhy Python has no method overloading, singledispatch, typing.overload, operator dunders and reflected ops, alternative constructors, multiple dispatch, virtual calls, and bound methods.27 concepts
- Decorators & metaprogrammingSeniorWriting decorators that introspect cleanly, metaclasses vs __init_subclass__, dynamic attribute access, code generation, @override and @final.20 concepts
- OOP, design & patternsSeniorComposition vs inheritance, SOLID with Python-specific teeth, Singleton/Strategy/Observer/Command/Adapter the Pythonic way, DI, mixins, and when a GoF pattern is just ceremony.13 concepts
- Immutability & constSeniorThe built-in immutable types, shallow vs deep immutability, typing.Final and Enum, and whether a custom object can truly be made immutable.8 concepts
- Type system & static typingSeniorProtocol vs ABC, variance in generics, TypedDict vs dataclass vs pydantic, and from __future__ import annotations.5 concepts
- Functional patterns & iteratorsSenioritertools internals, iterator vs iterable and the __getitem__ fallback, and functools.reduce vs a plain loop.4 concepts
- Context managersSeniorThe full with protocol — call sequencing, what __exit__ returns, ExitStack, and the generator-based form's traps.8 concepts
- Error handling & exceptionsSeniorThe exception hierarchy, cause vs context chaining, custom hierarchies, EAFP vs LBYL, retries and service boundaries, logging, and tricky propagation.17 concepts
- Memory management & performanceSeniorReference counting and GC, __slots__, boxing and list growth, weakrefs, the lru_cache leak, fork copy-on-write, and diagnosing leaks and latency in production.15 concepts
- Threads, processes & the GILSeniorWhat the GIL does and doesn't prevent, threading vs multiprocessing vs asyncio for mixed workloads, and lock-ordering deadlocks.3 concepts
- Async PythonSeniorThe event loop and what await really does, tasks and cancellation, races and sync primitives, async generators and context managers, structured concurrency, calling sync code, and debugging async services.35 concepts
- Data structures & algorithmsMid / SeniorComplexity of the built-ins, deque/Counter/defaultdict/heapq/bisect/namedtuple, Timsort stability, dict collisions, recursion limits, and the classic interview problems.15 concepts
- Imports, packaging & environmentsSeniorimport foo step by step, circular imports, regular vs namespace packages, and version pinning with lockfiles, pip-tools, poetry and uv.4 concepts
- Testing & test doublesMid / SeniorTesting time and randomness, the test-double taxonomy and Mock pitfalls, where to patch, fixture scopes, property-based and mutation testing, and flaky tests.17 concepts
- Security & adversarial inputSeniorWhy eval/exec and untrusted pickle are dangerous, SQL injection in Python, and timing-safe comparison.4 concepts
- C extensions & alternative implementationsSeniorctypes/cffi/Cython/pybind11 trade-offs, releasing the GIL around C calls, and CPython vs PyPy vs Jython/IronPython.13 concepts
- Service architecture & LLM integrationSeniorScaling a Python service, monolith vs microservices, streaming LLM tokens, GPU-bound inference, token-per-minute backpressure and long-running memory.6 concepts