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.
| Title | Difficulty |
|---|---|
| Design a Pub/Sub System Design an in-memory publish/subscribe broker with topics, a bounded inbox per subscriber, a drop-oldest policy for slow readers, and async delivery by dispatcher threads. | Medium |
| Design a Rate Limiter Design an in-process rate limiter with per-client limits and pluggable fixed window, sliding window and token bucket algorithms, then make it safe for many 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 Rule Engine Design a fraud rule engine for card payments, with conditions composed from AND, OR and NOT, velocity rules, the most severe action winning, and safe rule changes under concurrent load. | Medium |
| Design a Skiplist Design a skip list with search, add and erase in O(log n) on average: a sorted linked list with express lanes, random node heights you can replay, duplicates, and the follow-ups on maps, ranks and threads. | Hard |
| 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 a Top-K Tracker Design a tracker for the top K songs, hashtags or posts over a sliding time window, with per-second buckets, a size-K heap, per-source charts and the follow-ups on scale and threads. | Medium |
| Design a Traffic-Light Intersection Design a thread-safe controller for a two-road intersection: cars from four directions, one green road at a time, switching only when needed, and no crashes or deadlocks. | Easy |
| Design an API Aggregator Design a flight price aggregator that queries many providers in parallel behind one interface, enforces a deadline, returns partial results with per-provider status, and skips providers that keep failing. | Medium |
| Design an ATM Design an ATM with card and PIN sessions as a State pattern, card blocking after wrong PINs, all-or-nothing cash dispensing by note, deposits, and safe concurrent withdrawals from one account. | Medium |
| Design an In-Process MapReduce Design a multithreaded MapReduce inside one process: split the input, map on worker threads, shuffle pairs into partitions by key, reduce in parallel, with word count and an inverted index as jobs. | Medium |
| Design an LRU Cache Design a fixed-size cache with a pluggable eviction policy: LRU with a hash map and a doubly linked list, LFU with LRU tie-breaking in O(1), and a thread-safe sharded version. | Medium |
| Design an Online Auction System Design an online auction system with bid rules, auctions that close exactly at their end time through a min-heap of deadlines, per-bidder winnings, and safe concurrent bidding with per-auction locks. | Medium |
| Design an Order Matching Engine Design a stock exchange's order book and matching engine with limit and market orders, price-time priority, partial fills and cancels, matched in batch first and then as a stream. | Hard |
| Design an Underground System Design a metro tap-in and tap-out system that tracks riders between stations and answers the average travel time of any route in constant time, with the rules for double taps and missing check-ins. | Medium |
| Design Concurrent Bank Transfers Design a bank where many threads move money between accounts at once, with per-account locks taken in a fixed order so transfers never deadlock and the total is always conserved. | 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 |
| Design Movie Ticket Booking Design a BookMyShow-style booking system with shows, seat maps, temporary seat holds that expire, confirm and cancel, and safe booking when many users want the same seat. | Medium |
| Design the Sleeping Barber Design a thread-safe barbershop where the barber sleeps when nobody waits, arriving customers take a waiting chair or leave when the shop is full, and each customer waits for their own haircut. | Medium |
| Design the Unisex Bathroom Design a thread-safe shared bathroom that holds one gender at a time, never more than its capacity, and lets everyone in eventually, using a lock, a condition variable and a ticket line. | Medium |