System Design · Practice problems
System design problems
Build a design, run it, then submit it against tests you cannot see.
Each problem gives you a situation, the numbers your design must meet and the parts you may use. You build the design on a canvas, run it against the visible tests, then submit it against hidden ones: a spike, a crash, a slow dependency. A failed test says what broke and why.
Every problem, easiest first
Read-Heavy API Design: Practice Problem
Design the read path for an API that is mostly reads, then run it against spikes and a cold start. Practise cache-aside, read replicas and hot keys.
Stop a Cache Stampede: Practice Problem
When a popular entry expires, thousands of readers hit the database at once. Practise single flight and origin shields, then measure your design.
Presigned URL or Server Upload: Practice
Should 100 MB uploads pass through your servers or go straight to storage with a presigned URL? Measure both on network lines and cost, then submit.
Run 3,000 Jobs Due at Once: Practice
Run a burst of scheduled jobs against a dependency that can only take so many. Practise queues, pacing and retries with jitter on a canvas that runs.
Third-Party API Rate Limits: Practice
Your push provider refuses anything past 500 calls a second. Queue the work, pace workers to the limit, retry safely, and lose nothing when a worker dies.
Retry a Payment Without Charging Twice
A timeout does not say whether the charge happened. Retry it safely with idempotency keys, then test your design against a slow provider and hidden tests.
Transactional Outbox: Practice Problem
Save an order and tell Billing about it, even when the queue or Billing is down. Practise the transactional outbox, relays and harmless repeats.
Scale WebSockets Across Servers: Practice
Route each message to the one server holding its recipient's WebSocket, and survive a server dying. Practise connection directories and reconnects.
Rate Limiting Across Multiple Servers
Hold each client to its limit when its calls land on many servers, so only the noisy client suffers. Practise token buckets and failing open or shut.
Top K Over a Sliding Window: Practice
Keep a live top ten of the last 30 seconds without recounting everything. Practise time buckets, stream processing and hot keys, then run it on a goal.
LLM Provider Failover: Practice Problem
Keep an AI feature up when a model provider fails, with two providers that each fall short of your peak. Practise fallback order and queued work.
Exactly-Once Counts in a Stream: Practice
Count every ad click once through crashes, resends and a full database. Practise stream processing, dedupe keys and saving your place with your totals.
Ticket Holds That Expire: Practice Problem
Hold a ticket while the buyer pays and release it when they walk away, without selling one twice while a store is down. Practise atomic claims.
Fan-Out on Write vs Read: Practice
Copying each post to every follower works until one author has millions. Choose fan-out on write, on read or a mix, then run it against a TV chef.
Survive a Retry Storm: Practice Problem
A short timeout and generous retries can turn a five second outage into a long one. Practise timeouts, backoff and limits, then watch the storm.
By GOAT Engineer. System Design · Privacy Policy · Contact.