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.
34 write-ups
| Title | Difficulty |
|---|---|
| Design a Shopping Cart with Coupons Design an e-commerce cart with stock checks, automatic buy-X-get-Y offers, coupons scoped to a cart, product or seller with validity windows and usage limits, and an all-or-nothing checkout. | 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 a Vehicle Rental System Design a car and bike rental system with vehicle types, time-range bookings without double-booking, pick-ups and returns, duration pricing with late fees, and constant-time rented counts. | Medium |
| Design a VM Provisioning System Design the scheduler behind a small cloud: hosts with CPU and memory, VMs placed by a swappable first-fit, best-fit or spread policy, release of capacity, and draining hosts for maintenance. | Medium |
| Design a Webhook Dispatcher Design a service that sends events to subscribers' URLs, with event-type subscriptions, signed requests, retries with exponential backoff, and dead letters that can be replayed. | Medium |
| Design an Alerting System Design an alerting engine with metric threshold (query) checks and health checks, an OK / PENDING / FIRING state machine with a "for" duration, and notifications on firing and resolving. | Medium |
| Design an In-Memory Search Engine Design an in-memory search engine with datasets, document insert and delete, word and prefix search through an inverted index, and swappable result orderings. | 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 Inventory Management System Design multi-warehouse inventory: on-hand and reserved stock, reservations that are committed or released, a swappable rule for picking warehouses, and low-stock alerts that fire once. | 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 Game Matchmaking Design a matchmaker that groups players by mode (1v1, 2v2, 4v4), region and level, joins an open lobby or creates one, starts full games and splits them into balanced teams. | Medium |
| Design Nested Comments Design a Reddit-style comment tree with replies at any depth, votes, soft deletes, top/new/old sorting at every level, eager versus lazy loading with "load more" markers, and word search. | Medium |
| Design Splitwise Design an expense-sharing app with equal, exact and percent splits, fair rounding of cents, pairwise balances that net out, settle-ups, and a greedy plan that simplifies everyone's debts. | Medium |
| Design Tetris Design Tetris with seven piece shapes, rotation that stays in place, collision checks, gravity and locking, line clears with scoring, and a game loop that keeps time out of the rules. | Medium |