Low-level design
Object-oriented design for interviews: the framework, design principles and patterns, concurrency, and problem breakdowns you can practice in the code runner.
Object-oriented design for interviews: the framework, design principles and patterns, concurrency, and problem breakdowns you can practice in the code runner.
9 write-ups
| Title | Difficulty |
|---|---|
| Build a Semaphore, Latch and Barrier Build a counting semaphore, a countdown latch and a reusable barrier from one lock and a condition variable, and learn the wait loop behind every blocking primitive. | Medium |
| Coordinate Threads in Order Make threads take turns in a fixed order with one recipe, shared turn state plus a condition variable, applied to print in order, FooBar, zero-even-odd, H2O and multithreaded FizzBuzz. | Easy |
| Design a Multi-Stage Pipeline Design an in-process pipeline whose stages run on their own threads, joined by bounded queues for backpressure, with a poison-pill shutdown that finishes every accepted item. | Medium |
| Design a Multithreaded Download Manager Design a download manager that splits files into chunks fetched in parallel by a worker pool, retries failed chunks, supports pause and resume, and reports progress safely across threads. | Medium |
| Design a Request Batcher Design a request batcher that groups calls from many threads into one backend call, flushes when a batch is full or its time window ends, and hands every caller its own result. | Medium |
| Design a Thread Pool Design a fixed-size thread pool with a bounded task queue, futures that carry results and errors, a pluggable rejection policy, and a graceful shutdown that finishes queued work. | Medium |
| Design Dining Philosophers Let n philosophers share n forks with no deadlock and no starvation, from why "left fork first" gets stuck to a fair waiter that hands out both forks at once. | Medium |
| Implement a Promise / Future Build a thread-safe promise that settles once, wakes blocked readers with timeouts, runs then-callbacks exactly once, and combines results with allOf and anyOf, like a small CompletableFuture. | Medium |
| Implement a Read-Write Lock Build a read-write lock from a mutex and a condition variable, with writer preference so writers never starve, try methods, and the upgrade, reentrancy and fairness follow-ups. | Medium |