Python's readability hides an unusually wide competence range — the same syntax serves scripters and engineers who ship resilient systems. These questions surface engineering depth: the object model, async judgment, typing discipline, and production habits, with notes on what strong answers cover.
What a strong answer covers
Defaults evaluated once at function definition, so a mutable default accumulates state across calls; the None-sentinel idiom as the fix. The 'why' — def as an executed statement binding objects — separates engineers who understand the model from those who memorized the gotcha.
What a strong answer covers
Pass-by-object-reference: rebinding inside a function is local, mutation is visible outside. Real stories involve lists or dicts mutated through aliases, shallow versus deep copies, or class attributes shared across instances. Precision here predicts fewer mystery bugs in review.
What a strong answer covers
Lazy evaluation for large or infinite sequences, constant memory, pipeline composition; consumption-once semantics and the debugging cost of laziness as trade-offs. Generator-based file or API-page processing examples are the practical grounding; yield from and generator cleanup are bonus depth.
What a strong answer covers
One thread executing Python bytecode at a time — I/O releases the GIL, so threads still help I/O-bound work; multiprocessing for CPU-bound; asyncio for high-concurrency I/O with cooperative scheduling. Awareness of free-threaded Python's arrival and C-extension escape hatches (NumPy releasing the GIL) marks currency.
What a strong answer covers
Coroutines scheduled on an event loop; breakers: blocking calls (requests, time.sleep, sync DB drivers) freezing the loop, fire-and-forget tasks garbage-collected or swallowing exceptions, and missing timeouts. run_in_executor and task-reference discipline as fixes. The blocking-call trap is the core production lesson.
What a strong answer covers
Hints as standard for professional code at boundaries and domain logic, mypy or pyright in CI at meaningful strictness, Protocol for structural typing, and honest notes on gradual adoption in legacy code. Runtime validation (pydantic) at I/O boundaries as a complement shows the full picture.
What a strong answer covers
Locked dependencies (uv, poetry, or pip-tools), pyproject.toml as the project spec, isolated environments per project, and reproducibility in CI and Docker. A one-command bootstrap answer signals team-scale habits; 'pip install into system Python' is the failing answer.
What a strong answer covers
Dependency injection by passing collaborators, pure logic separated from I/O, decorators for cross-cutting concerns (retry, timing, auth) with functools.wraps hygiene, context managers owning resource lifecycles. Ability to sketch a decorator from memory is a fair fluency check.
What a strong answer covers
tracemalloc snapshots or memray profiles compared over time, suspects: unbounded caches and lru_cache on unbounded key spaces, global registries, large objects pinned by closures or exception tracebacks, C-extension leaks. Confirming the fix with the same measurements closes the loop properly.
What a strong answer covers
pytest with fixtures for composition, parametrize for case tables, restraint in mocking (patch where used, not where defined — and only at seams), and hypothesis for property-based testing of parsers and invariants. Over-mocked test suites named as a smell is the senior tell.
What a strong answer covers
Profile first (cProfile, py-spy in production), fix algorithms and data structures, push hot loops into NumPy/vectorized or compiled paths, caching, then Cython/Rust extensions or subprocess parallelism as later resorts. Measured, staged escalation rather than reflexive rewrites is the judgment on display.
What a strong answer covers
Instantiation versus initialization, and practical protocol wins: __enter__/__exit__ for resources, __iter__ for natural looping, __eq__/__hash__ with their contract, dataclasses generating the boilerplate. The applied example matters more than exhaustive dunder recall.
What a strong answer covers
Version control and reproducible environment first, characterization tests around outputs, decompose into functions and modules with typed boundaries, extract config from code, add CI. Incremental hardening with the team rather than a rewrite — respect for working code under change pressure.
Skip the interviews entirely — get matched with pre-vetted Python developers in 48 hours, $0 until you hire.
Need a custom question set?
Our free interview question generator builds a tailored list for any role, seniority, and focus area.
Try the interview question generator →The object-model, generator, packaging, and testing questions transfer intact; swap the async and service-structure questions for our data scientist set's modeling and pipeline questions. Engineering discipline gaps hurt data teams just as much — keep the memory and typing questions.
A short one pays for itself: implement a retry decorator or a generator-based batch processor in twenty minutes. Both exercises make closures, laziness, and error handling visible — exactly the fluency these questions test conversationally.
Add a framework block matching your stack — our Django set covers that path deeply. But hire on this foundation first: framework APIs are learnable in weeks, while the typing, testing, and async judgment probed here take years to develop.
Hire directly
Hire vetted Python developers in the USA →Other interview guides
Vetted talent ready for US teams. No recruitment fees. Zero risk.
🇺🇸 Trusted by companies across the United States