System design interview questions
Each one is a system you design from its requirements: decide, explain why, see the consequences, break it, change the constraints, and defend what is left. New to the format? Start with how the interview works.
- A URL shortener like bit.lyDesign a URL ShortenerShort links that never collide, redirect quickly for users anywhere, count every click, and can be switched off in seconds. You will estimate the load first, then design each part from the numbers.Foundational, 45 min9 stages
- A reliable video processing pipelineDesign a Video Processing PipelineInstructors upload multi-gigabyte lectures that take minutes to transcode. Workers crash, deploys interrupt jobs, and the same job can run twice. Every accepted upload must end in exactly one correct, visible outcome.Intermediate, 55 min14 stages
- Rate limiting a public APIDesign an API Rate LimiterA public API must hold every customer to their plan across thirty stateless servers, absorb honest bursts, stop abuse, and never let the limiter itself become the outage.Intermediate, 40 min10 stages
- A home timeline at 300,000 reads a secondDesign a News Feed (Twitter Timeline)Built from Twitter's own account of its home timeline: decide when the work of 'one post, many followers' happens, survive accounts with thirty million followers, and stop precomputing timelines for people who never come back.Intermediate, 45 min9 stages
- A job queue that keeps working when workers fall behindDesign a Distributed Job QueueBuilt from Slack's account of the outage that made it rebuild its job queue: make enqueues safe when workers fall behind, keep one slow job type from starving the rest, and drain a backlog without causing the next outage.Intermediate, 45 min9 stages
- Product analytics over billions of eventsDesign a Product Analytics SystemTake in billions of product events a day and answer questions nobody planned for in seconds: choose where events live, keep ingestion alive through spikes and outages, make filters on people fast, and decide what happens when two anonymous visitors turn out to be one person.Intermediate, 45 min9 stages
- Notifications across email, push and in-appDesign a Notification SystemProduct events become emails, push notifications and inbox items for millions of users. Respect every preference immediately, never notify twice, survive provider outages, and get the security alert out while a five-million-email announcement is in flight.Intermediate, 50 min11 stages
- A payment workflow that never double-chargesDesign a Payment SystemCheckout calls a payment provider that can be slow, can time out after it succeeded, and sends webhooks more than once and out of order. Keep every order's payment state correct through retries, crashes and uncertainty.Advanced, 60 min13 stages
- A look-aside cache at Facebook's scaleDesign a Distributed Cache (Memcache)Built from Facebook's paper on scaling memcache: a look-aside cache serving billions of reads a second, Reads are fast; the hard parts are stale values, stampedes on popular keys, dead servers and invalidations that have to cross regions.Advanced, 50 min9 stages
- Storing trillions of chat messagesDesign Discord's Message StorageBuilt from what Discord's engineers published about storing billions, then trillions, of messages: choose a partition key that keeps every read small, survive a channel full of deletions and a channel everyone opens at once, then move the whole thing to a new database while it is running.Advanced, 45 min9 stages
- A real-time collaborative editorDesign a Collaborative Editor (Google Docs)Many people edit the same document at once over unreliable connections. Every client must converge on the same text, no acknowledged keystroke may be lost, and daily deploys must not kick anyone out.Advanced, 60 min12 stages
- Live queries: screens that update in real timeDesign a Reactive Database (Live Queries)Replace polling with live queries: work out which writes change which results, keep every screen consistent with itself, stop two people breaking a rule at the same moment, and survive one query that a whole company is watching.Advanced, 45 min9 stages
- Sharding Postgres while it is runningShard a Live Database Without DowntimeBuilt from how Notion sharded Postgres while millions of people were using it: choose a shard key, choose a shard count you can live with for years, move every row while writes continue, prove the copy is right, and grow again later without starting over.Advanced, 50 min9 stages