System design scenario bank
Worked system design scenarios: a URL shortener, notification fan-out, chat, uploads, search, an exam platform, a traffic spike, multi-tenant SaaS and ticketing.
13 lessons
Classic warm-ups
Fan-out and real time
- 3Scenario: notification fan-outOne event becomes one job per recipient and channel, each channel paced by its own provider and recorded once.
- 4Scenario: chat and presenceStore every message until each device says it has it, and announce presence only when it changes.
- 5Scenario: news feedPay for a feed when posting, except for the few huge accounts, which every reader merges in at read time.
Files, search and money
- 6Scenario: file and image upload pipelineLet storage take the bytes into quarantine, and let a worker that trusts nothing but the bytes promote them.
- 7Scenario: search with facetsThe index is a derived copy: feed it, rebuild it, and count each facet without its own tick.
- 8Scenario: payments ledgerWrite money as entries summing to zero, serialise each account's debits on its row, and post each payment once, checked nightly by id.
ExamHall and SaaS
- 9Scenario: the exam engine and its anti-cheat pipelineThe server owns each candidate's clock and closes each attempt itself; anti-cheat signals are claims to review, never verdicts.
- 10A scheduled exam-start spikeA scheduled start needs one coordinated readiness plan and a rehearsal of the traffic that will actually arrive.
- 11Scenario: multi-tenant SaaSPick what tenants share layer by layer, give shared workers turns, run migrations as N jobs, and scope every copy of a row.
More scenarios
- 12Scenario: ticketing on-sale with seat holdsHold with a timed row and a guarded update, guard the confirm too, and let the waiting room absorb the crowd.
- 13Scenario: video-on-demand streamingThe app decides who may watch; transcoders, storage and the CDN move the bytes, and the bill is the bytes viewers receive.