Design interview problems
Design problems in a practical round are small-scale software design, not whiteboard architecture. You build a class or module with a clean public API, such as a key-value store with transactions, an in-memory file system, an event bus or a plugin registry, and then extend it through a series of follow-ups. Python tools that help are dataclasses for plain records, enum.Enum for states, typing.Protocol for pluggable dependencies, and abc.ABC when you need enforced overrides.
Interviewers grade how well the first version survives the second and third requirement. Common problems are a god class with every method, booleans that encode a state machine badly, hard-coded time.monotonic() calls that make tests sleep, and leaking internal dicts to callers who then mutate them. A strong answer starts with the data model and the method signatures, injects the clock and other side effects, keeps invariants inside the class, and refactors in place when a follow-up exposes a bad early choice instead of bolting on a special case.
1 open problem
- 16Async Circuit Breakerhard
Implement an asyncio circuit breaker with closed, open and half-open states, a single recovery probe, and protection against stale in-flight calls.
4 locked
These open in order of demand. Open one and press I want this one to ask for it.
- 07Inference Request Queue Lockedmedium
Design a FIFO request queue with a status lifecycle: submit, start, complete and cancel, with O(1) operations and lazy removal.
- 29Round-Robin Load Balancer Lockedeasy
Route async requests to model replicas in round-robin order, skipping replicas marked unhealthy and failing fast when none are left.
- 35Atomic File Copy Lockedmedium
Copy a file through a temp file and atomic rename so readers never see a partial destination, with progress callbacks and cleanup on failure.
- 49Reference-Counted Model Manager Lockedhard
Load each model once for many concurrent users, unload it when the last user releases it, and handle load failures and acquires during unload.