SYSTEM DESIGN · TRACK 6
Design Problems
The questions interviewers ask, solved step by step with the LADDER method: requirements, scale, API and data, the high-level design, the hard parts in depth, and the trade-offs.
All 41 are live. Each one is an animated walkthrough you can step through, written notes, and the interview questions with answers.
Warm-ups
Read/write ratio, hashing, a single hot path
- 1 URL shortenerA full walkthrough of the classic warm-up with the LADDER method: requirements, scale math for 100 million new links a month at a 100 to 1 read ratio, the API and data model, the high-level design, then the parts interviewers probe: generating unique 7-character codes with base62 and ID ranges, 301 vs 302, caching the redirect path, custom aliases, expiry and abuse.
- 2 PastebinA LADDER walkthrough of a paste-sharing service: requirements, scale math for ten million pastes a day, the API and a split data model with metadata in a database and text in object storage, then the deep dives: unguessable keys, compression, caching immutable content at the CDN, expiry and burn-after-reading, and abuse limits, with trade-offs and a short interview summary.
- 3 Rate limiterA LADDER walkthrough of a rate limiter shared by many gateway servers: requirements, scale math for half a million requests a second and ten million keys, the rule and response API, Redis state, then the deep dives: choosing token bucket, atomic updates with a Lua script, keeping the added latency under a millisecond, sharding and hot keys, failing open, multiple regions and rolling out new rules safely.
- 4 Unique ID generatorA LADDER walkthrough of generating unique IDs across hundreds of servers: requirements, scale math for a million IDs a second, why a single auto-increment fails, a comparison of UUIDs, database steps, range blocks and Snowflake-style IDs, then the deep dives: the 64-bit layout, assigning worker IDs, clocks that jump backwards, sequence overflow, ordering guarantees and practical pitfalls.
Chat and real time
Persistent connections, fan-out, ordering, presence
- 5 WhatsAppA LADDER walkthrough of a mobile chat system: requirements, scale math for 20 billion messages a day and 200 million open connections, the WebSocket and REST API, a message store partitioned by conversation, then the deep dives: routing between chat servers, offline delivery and push, sent-delivered-read receipts, per-conversation ordering, group fan-out, presence, media and end-to-end encryption.
- 6 Live commentsA LADDER walkthrough of live comments on streaming video: requirements, scale math that shows why naive fan-out to two million viewers is impossible, the API and data model, then the deep dives: per-stream pub-sub with connection servers subscribing once, batching and sampling for hot streams, partitioned writes, moderation and deletes, late joiners and replay, and failure handling.
- 7 SlackA LADDER walkthrough of a workplace chat system: requirements, scale math for a billion messages a day and thirty million sockets, the API and a data model sharded by workspace, then the deep dives that make it different from WhatsApp: channel subscriptions on gateway servers, unread counts and mentions across devices, threads, permission-aware search, notifications and reconnect catch-up.
- 8 Google DocsA LADDER walkthrough of a collaborative document editor: requirements, scale math for millions of concurrent editors, the API and an operation-log data model, then the hard parts: why concurrent edits conflict, operational transformation versus CRDTs, one session server per document, durability with an op log and snapshots, failover, offline edits, live cursors, version history and permissions.
- 9 ZoomA LADDER walkthrough of a video conferencing system: requirements, scale and bandwidth math for ten million concurrent participants, the signalling API and data model, then the deep dives: mesh vs MCU vs SFU, UDP and NAT traversal with TURN, simulcast and bandwidth adaptation, jitter and packet loss, cascading SFUs across regions, failover, webinars over a CDN, recording and encryption.
Feeds and social
Push vs pull, the celebrity problem, ranking, media
- 10 InstagramA step-by-step design for a photo-sharing app with a home feed: requirements, scale math for half a billion daily users, the upload API with pre-signed URLs, async resizing into several sizes, a CDN for images, hybrid push and pull fan-out for the feed, the celebrity problem, feed caching and cursor pagination, and the trade-offs to name.
- 11 News FeedHow to design a ranked social news feed for a billion daily users: scope, traffic and memory math for per-user inboxes, the feed API and data model, fan-out of friend posts through an event stream, candidate generation and multi-stage ranking, privacy filtering at read time, seen-state and new-post signals, and the trade-offs you should name.
- 12 Twitter / XA full walkthrough of a short-post platform like Twitter or X: requirements, the read-heavy scale math, time-sortable IDs, the tweet and timeline APIs, user versus home timelines, hybrid fan-out in a timeline cache, the celebrity problem, near real-time search with an inverted index, trending topics with windowed counts, and the trade-offs to name.
- 13 TikTokHow to design a short-video app with an interest-based feed: requirements, scale math for a billion daily viewers, upload and transcoding into adaptive bitrate renditions, CDN delivery and prefetching for instant playback, a recommendation pipeline of embedding retrieval and ranking, real-time watch signals, moderation before distribution, and the trade-offs to name.
- 14 RedditA step-by-step design for a community discussion site like Reddit: requirements, scale math that shows it is a read and ranking problem rather than a storage one, the API and data model, precomputed hot and top listings per community, a pull-and-merge home feed, voting at high write rates without double counts, nested comment trees, edge caching for logged-out readers, and the trade-offs.
Media and storage
Chunking, transcoding, CDN, metadata vs blobs
- 15 Google DriveHow to design a cloud file storage and sync service like Google Drive or Dropbox: requirements, storage and traffic math, splitting files into content-addressed blocks, resumable uploads and deduplication, separating metadata from blobs, a change journal with cursors so every device syncs, push notifications, conflict handling and version history, sharing permissions, and the trade-offs.
- 16 YouTubeHow to design a long-form video platform like YouTube: requirements, upload and egress math, resumable upload sessions, a transcoding pipeline built as a DAG of parallel jobs, adaptive bitrate streaming with HLS or DASH, CDN tiers and origin shielding for the long tail, counting billions of views with dedupe and batching, metadata storage, and the trade-offs.
- 17 NetflixHow to design a subscription streaming service like Netflix: requirements, peak concurrent stream math, splitting a cloud control plane from a CDN data plane, encoding a known catalog ahead of time, pre-positioning files in caches inside ISPs during quiet hours, steering each play to the best cache, DRM licences, a resilient continue-watching history, and the trade-offs, using only widely published ideas.
- 18 SpotifyHow to design a music streaming service like Spotify: requirements, listening and catalog math, why audio is a small-file problem unlike video, CDN delivery with a client cache and gapless prefetch, per-country rights checks, a versioned playlist model for collaborative edits, offline downloads with licence expiry, play counts accurate enough for royalties, batch recommendations, and the trade-offs.
Location
Geohash and quadtrees, matching, ETA
- 19 Yelp / proximity serviceHow to design a proximity service like Yelp: requirements, scale math showing the whole geo index fits in memory, the nearby-search and business APIs, why a plain latitude and longitude index fails, geohash cells and neighbour lookups, quadtrees and S2 or H3 as alternatives, combining distance with filters and ranking, rating aggregation, caching, and the trade-offs.
- 20 Food deliveryHow to design a food delivery platform that connects customers, restaurants and couriers: requirements, dinner-peak math, the order and tracking APIs, an order state machine with idempotent payments, ingesting courier GPS pings into an in-memory geo index, dispatch that scores and offers orders to couriers with timeouts and batching, ETAs from prep time and travel time, and the trade-offs.
- 21 UberA senior-level design for a ride-hailing app like Uber: requirements, the math for half a million location updates a second, rider and driver APIs, a sharded in-memory supply index on hexagon cells, nearest-driver search by ETA rather than distance, matching that never double books a driver, batched matching, surge pricing per cell, a trip state machine, cell-based isolation, and trade-offs at 10x.
- 22 Google MapsA senior-level design for a maps and navigation service like Google Maps: requirements, tile and probe math, the tile, search and route APIs, pre-built vector tiles on a zoom pyramid served from a CDN, why plain Dijkstra is too slow on a continent and how preprocessing such as contraction hierarchies fixes it, live traffic from phone speed probes and map matching, ETA prediction, rerouting, and the trade-offs.
Search and discovery
Tries, inverted indexes, crawling, aggregation
- 23 Search autocompleteDesign the typeahead box that suggests the top five queries as you type. Requirements and scale (over a hundred thousand requests a second at peak), the suggest API, a trie with top-K cached at every node, an offline pipeline that rebuilds it from query logs, a small real-time layer for trending terms, replication versus sharding, client-side tricks and the trade-offs.
- 24 Web crawlerDesign a crawler that fetches a billion pages a month without hammering any site. Requirements and scale, the control interfaces and URL table, the fetch-parse-enqueue loop, then the hard parts: a URL frontier with priority and per-host politeness queues, URL and content deduplication with Bloom filters and fingerprints, spider traps, recrawl scheduling, partitioning by host, and the trade-offs.
- 25 News aggregatorDesign an app that gathers articles from fifty thousand publishers and shows each reader a fresh, ranked list of stories. Requirements and scale, the feed API and data model, then the hard parts: adaptive feed polling and push, deduplicating and clustering articles into stories, ranking by recency and coverage, personalizing by blending precomputed section lists, caching, and the trade-offs.
- 26 Google SearchDesign a web search engine that answers hundreds of thousands of queries a second over tens of billions of pages. Requirements and scale, the search API and index data model, building a document-partitioned inverted index, a fresh tier for news, scatter-gather query serving with tail-latency tricks, multi-stage ranking with link-based signals, caching, failure handling and the trade-offs.
Commerce and money
Inventory, consistency, idempotent payments, hot keys
- 27 E-commerce (Amazon)Design an online store where millions browse and thousands check out every minute. Requirements and scale, the shopping API and data model, then the hard parts: a read-optimized catalog with search and caching, a cart in a key-value store, inventory reservations that never oversell, a checkout saga with idempotent payments and an outbox, the order state machine, and where you can be eventually consistent.
- 28 Movie bookingDesign a ticket booking app where thousands of people fight over the same few hundred seats. Requirements and scale, the booking API and seat data model, then the hard parts: atomic multi-seat holds with expiry, optimistic versus pessimistic locking, tying payment to a hold without double booking, a virtual waiting room for blockbuster releases, live seat maps, and the trade-offs.
- 29 Flash saleDesign a sale where ten thousand phones go on sale at noon and ten million people click at once. Requirements and a burst of millions of requests a second, the claim API and data model, why one inventory row melts, then the hard parts: a filtering funnel at the edge, atomic stock claims in Redis with split buckets, asynchronous order creation through a queue, payment windows that return stock and reconciliation.
- 30 Payment systemDesign the payment service behind an online store, where the hard part is never charging twice and never losing money. Requirements and scale, the payments API and data model, then the hard parts: idempotency keys end to end, the payment state machine, unknown outcomes after timeouts and webhooks, a double-entry ledger, daily reconciliation with the provider, tokenization to stay out of card data, and the trade-offs.
- 31 Digital walletDesign a wallet app where a hundred million people top up, send money to friends and pay shops. Requirements and scale, the wallet API and ledger data model, then the hard parts: atomic same-shard transfers that never go negative, cross-shard transfers with a saga and a clearing account, single-writer event sourcing for very high throughput, hot merchant accounts, holds, limits and reconciliation with the bank.
- 32 Stock exchangeDesign an exchange that matches buy and sell orders in microseconds, fairly and without ever losing one. Requirements and bursty scale, the order protocol and in-memory order book, then the hard parts: price-time matching, order book data structures, a sequencer and single-threaded engine per symbol, a replicated journal with a hot standby that replays it, pre-trade risk checks and sequenced market data.
Counting and ranking
Sharded counters, approximate counting, top-K
- 33 Likes counterHow to design the like button and its count for a large social app: one like per user, counts that are a few seconds behind but never drift, a write path through an event log and a batching aggregator, sharded counters for viral posts, outbox and offsets for exactly-once counting, a reconciliation job, and a cached read path that serves feed-sized batches.
- 34 Real-time leaderboardHow to design a live leaderboard for a game with a hundred million players: why SQL struggles with "what is my rank", how a Redis sorted set answers top 100, my rank and players around me in log time, tie-breaking, daily and weekly boards, sharding past one node, approximate ranks for the long tail, and keeping Redis a rebuildable view over a durable score store.
- 35 Top K (trending)How to find the top K most viewed items over the last minute, hour and day at a hundred thousand events a second: why one heap on one machine fails, partitioning counts by item so local top-Ks merge exactly, two-stage aggregation for viral items, sliding windows from tumbling buckets, count-min sketch for bounded memory, a fast stream path checked by an exact batch path, and what "trending" should mean.
- 36 Ad click aggregatorHow to count ad clicks for billing and live dashboards at fifty thousand clicks a second: a redirect path that never loses a click, signed impression IDs for deduplication and fraud checks, per-ad per-minute stream aggregation with event time and watermarks, exactly-once sinks, salted keys for hot ads, an OLAP store for advertiser queries, and a nightly reconciliation that billing trusts.
Platform and async
Queues, scheduling, workers, observability
- 37 Notification systemHow to design a shared notification service that any team can call: one API for push, SMS, email and in-app, user preferences and quiet hours, templates, separate priority queues so a marketing blast never delays a login code, per-provider rate limits, retries with backoff, deduplication, dead device tokens, bulk campaign fan-out and delivery tracking.
- 38 Job schedulerHow to design a shared scheduler that runs millions of one-off and cron jobs on time: a jobs table indexed by next run time, partitioned schedulers that claim due work with leases, a unique run key so each tick fires once, a queue and worker pool with heartbeats, retries, timeouts and fencing tokens, and the midnight thundering herd, priorities and per-team quotas.
- 39 CI/CD pipelineHow to design a hosted CI/CD system: webhooks that start pipelines, YAML parsed into a DAG of jobs, runners that pull work with leases, ephemeral sandboxes and short-lived secrets, live log streaming, caching and test sharding for speed, immutable artifacts promoted from staging to production, and canary deploys that roll back on their own.
- 40 Online code judgeHow to design a site where users submit code that is compiled and run against hidden tests: an asynchronous submission flow, a judge queue and worker pool, sandboxes that contain hostile code with no network and strict CPU, memory and process limits, consistent timing for fair verdicts, checkers and rejudges, and a contest mode that survives a fifty-thousand-person start with live standings.
- 41 Monitoring and alertingHow to design a metrics monitoring and alerting system for a hundred thousand machines: collecting samples by pull or push, a buffered write path, a time-series database with compressed chunks and an inverted label index, the cardinality trap, downsampling for long ranges, rule evaluation with pending periods, an alert manager that groups and silences, and how to monitor the monitor.
The whole path
Concepts, technologies, building blocks, patterns, the LADDER method and the design problems.