Roadmaps / Python / Interview topics
Reference
Interview topics
Use these for Python, backend and data roles. Each follow-up is the question a good interviewer asks next. The Staff line is what lifts the answer.
Phase 1
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| What is the GIL? | How does the free-threaded build differ? | The costs measured, and which of your dependencies support it |
| How do you find why Python code is slow? | What if the profile is flat? | Sampling profiles, counters and a measured change, not a guess |
| How does memory work in CPython? | What causes a leak? | Reference cycles, caches without limits and tracemalloc evidence |
| Threads, processes or asyncio? | How do you decide? | The workload (CPU or I/O), the memory budget and a measured comparison |
System design prompt (20 minutes): an ingestion service for device events at 2,000 a second. Outline: requirements and numbers (3 min), concurrency model (5), storage (5), failure cases (4), observability (3).
Phase 2
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| How do you add typing to a large old codebase? | What do you do about Any? | A staged plan by package, a ratchet in CI and a count of Any over time |
| Where do you validate input? | Why not everywhere? | At the boundary, with typed models inside and tests for hostile input |
| How do you test code that uses a database? | Fake or real? | A real container for integration, fakes for unit tests and a shared test |
| What is a flaky test and what do you do? | How do you stop it returning? | A quarantine rule, a root-cause habit and a metric |
System design prompt (20 minutes): a typing and testing standard for ten teams. Outline: goals and cost (4 min), rollout (5), tooling (4), exceptions (3), measuring adoption (4).
Phase 3
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| How does asyncio work? | What breaks it? | The loop, tasks and what a blocking call does to all of them |
| How do you apply backpressure? | What happens without it? | Bounded queues, timeouts and a shed policy |
| When is it safe to acknowledge a write? | How do you prove it? | After commit, with a crash test that shows no loss |
| When do you leave Python for a hot path? | How do you decide? | A profile, a measured gain and the maintenance cost |
System design prompt (20 minutes): a webhook delivery service on Python. Outline: limits and numbers (4 min), queue and workers (5), retries and idempotence (5), shutdown (3), observability (3).
Phase 4
| Question | Follow-up | A Staff answer adds |
|---|---|---|
| How do you manage Python dependencies? | What about transitive ones? | A lockfile, an audit gate, a dependency budget and a review of new ones |
| How do you keep up with annual releases? | What if a dependency lags? | A schedule, a trial branch in CI and a stated support window |
| How do you make Python start faster? | What does it cost? | Import timing, lazy imports and the trade-off in debugging |
| When should a team not use Python? | What do you use instead? | A decision memo with the measured cost on a real component |
System design prompt (20 minutes): a standard Python platform for many teams. Outline: goals (3 min), tooling and templates (5), security and upgrades (5), support model (4), measuring outcomes (3).