Implement class APIs, model state machines, and test deterministic designs. Existing cache and rate-limiter exercises are cross-listed, not duplicated.
medium · classes + state, allocation
Low-Level Design
Design a parking lot with several floors. Each floor has spots of three
medium · state machine, SCAN scheduling
Low-Level Design
Design one elevator for a building of `num_floors` floors, numbered
medium · transactions, fault tolerance, rollback
Low-Level Design
Design an ATM. It holds accounts (`account_id` → balance in cents
easy · game state, turn validation
Low-Level Design
Implement a 3×3 Tic-Tac-Toe game. X moves first. `move` returns
easy · CRUD + business rules
Low-Level Design
Design a library. It tracks books (copies available), members, and
medium · hashing / encoding, idempotency, expiry
Low-Level Design
Design the core of a URL shortener as a single class. Short codes are
medium · state machine, exact change from a limited coin pool
Low-Level Design
Design a vending machine. Prices and money are integer cents.
medium · balances, greedy settlement
Low-Level Design
Design the core of Splitwise. Friends record expenses; each expense
medium · booking, atomicity, seat map
Low-Level Design
Design a movie ticket booking system. A show has numbered seats
medium · simulation, collision rules
Low-Level Design
Implement the Snake game on a `width × height` grid, rows `0..height-1`,
easy · levels, filtering, sink injection
Low-Level Design
Design a logging framework. Levels are `DEBUG < INFO < WARN < ERROR`.
medium · LRU eviction + time-based expiry
Low-Level Design
Design a cache with a fixed capacity. Every entry may carry a TTL
medium · trie
Low-Level Design
Design a search autocomplete system. `add(term, weight)` inserts a
medium · interval overlap, greedy room choice
Low-Level Design
Design a meeting room scheduler. Rooms have capacities. A booking
medium · fake clock, priority by due time
Low-Level Design
Design a one-shot task scheduler. `schedule(task_id, fn, delay_seconds)`
easy · observer, topics
Low-Level Design
Design a publish-subscribe system. Subscribers register a callback
medium · hashing, chaining
Low-Level Design
Implement a hash map for integer keys. `get` returns `-1` for a
medium · nearest-neighbour matching, ride lifecycle, fare
Low-Level Design
Design a ride-hailing system. Drivers and riders have `(x, y)`
hard · rules engine, move validation
Low-Level Design
Implement a simplified chess game on an 8×8 board. Rows `0..7`
medium · tree, paths
Low-Level Design
Implement a simple in-memory file system. Directories contain
medium · allocation (best fit), pickup codes, expiry
Low-Level Design
Design an Amazon Locker bank. The bank has lockers in three sizes —
easy · decorator
Low-Level Design
Design a pizza ordering system. There are three base pizzas —
medium · order lifecycle, nearest-partner matching
Low-Level Design
Design a food ordering system. Restaurants have menus (item →
medium · tree traversal, composable filters
Low-Level Design
Implement the core of the Unix `find` command over an in-memory
hard · limit order book, price-time priority
Low-Level Design
Implement a simplified stock exchange. Orders are placed for a
easy · a finite set with a seeded shuffle
Low-Level Design
Implement a standard 52-card deck. Ranks are `2–10, J, Q, K, A`;
medium · design
Design · Hash Table · Linked List
Amazon · Google · Meta · Microsoft
Build a cache with a fixed capacity that supports two operations: get(key) returns the stored value, or -1 if the key is not present; put(key, value) stores the pair, updating the value if the key already exists. When the cache is full and a new key is added, the least recently used key (the one not read or written for the longest) is evicted. Reading or writing a key marks it as recently used. The cache is created with LRUCache(capacity).
hard · frequency buckets
Design · Hash Table · Cache
Implement LFUCache(capacity), with nonnegative capacity. get(key) returns its integer value or -1 if missing; a successful get increases its frequency and makes it most recently used at its new frequency. put(key,value) returns None; inserting starts frequency 1, updating an existing key also increases its frequency. When full, evict the lowest-frequency key; tie-break by least recently used within that frequency. Missing gets do not change any recency or frequency. Capacity 0 stores nothing. Keys are integers and may be negative; aim for O(1) expected operations.
medium · fake clock
API · Simulation · Rate Limiting
Given capacity >= 1, refill >= 0 tokens per integer time unit, and requests in nondecreasing time order, return one admission boolean per request. The bucket starts full at time 0. Refill up to capacity according to elapsed time before each request; an admitted request costs one token. Rejected requests cost nothing. All values are integers, repeated timestamps are valid, and time never goes backward. Do not read a real clock or sleep.