System Design

#Question bank

Questions cluster into about eight shapes. Recognising the shape is most of the work — once you know a prompt is "fan-out with a hot-key problem", the derivation is familiar even if the domain is new.


#1 · The eight shapes

ShapeReally testsCanonical
Read-heavy key lookupCaching, CDN, sharding by keyURL shortener, pastebin
Fan-outPush vs pull, hot keys, amplificationNews feed, notifications
Connection-orientedStateful gateways, routing, presenceChat, collaborative editing
Strong consistencyLocking, transactions, reservationsTicketing, payments, inventory
Large mediaObject storage, CDN, pipelines, costVideo, photos, file sync
Crawl / ingestQueues, politeness, dedup, schedulingWeb crawler, log ingestion
Search / rankingInverted indexes, sync, two-stage retrievalSearch, typeahead, feed ranking
GeospatialSpatial indexing, proximity, matchingRide-hailing, nearby, delivery

When you get an unfamiliar prompt, classify it first. "This is essentially a fan-out problem with a hot-key case" both orients you and shows the interviewer you are reasoning from structure.


Interactive simulation — needs JavaScript.


#2 · The prompts

#Read-heavy key lookup

PromptReally asking
URL shortenerUnique ID generation; is it enumerable?
PastebinSame, plus expiry and large text bodies
Key-value storeConsistent hashing, replication, quorums
Distributed cacheEviction, hot keys, consistent hashing
API rate limiterAlgorithm choice, distributed counting, fail-open
Unique ID generatorSnowflake; clock skew; coordination-free
Leaderboard / top-kSorted sets, approximate counting, heavy hitters
Counting service (views)Hot-row contention, sharded counters, sampling

#Fan-out

PromptReally asking
Twitter / news feedPush vs pull; celebrity hybrid
InstagramSame, plus media pipeline
Notification systemMulti-channel, provider limits, dedupe
Email serviceBounces, reputation, retry classification
Live commentsFan-out at very low latency
Activity feedAggregation and grouping ("3 people liked…")

#Connection-oriented

PromptReally asking
Chat / WhatsAppWebSockets, routing registry, ordering, presence
SlackChannels, large groups, read state
Collaborative editorOT or CRDTs; conflict-free merging
Multiplayer game backendState sync, tick rate, lag compensation
Video call signallingWebRTC, TURN, session negotiation

#Strong consistency

PromptReally asking
Ticketmaster / seat bookingOptimistic locking, holds, waiting room
Hotel / flight reservationSame, plus multi-resource transactions
Payment systemIdempotency, ledgers, reconciliation
Inventory managementOversell prevention vs compensation
Digital walletDouble-entry ledger, atomic transfer
Distributed lock serviceFencing, lease expiry, why it is hard
Auction systemBid ordering, closing-time contention

#Large media

PromptReally asking
YouTube / NetflixTranscoding DAG, ABR, egress cost
Dropbox / Google DriveChunking, delta sync, conflicts
Photo sharingPresigned upload, variants, CDN
Podcast / audioSimpler pipeline, offline download
Backup serviceDedup, incremental, restore time

#Crawl / ingest

PromptReally asking
Web crawlerPoliteness frontier, Bloom filter, traps
Log ingestion / metricsHigh write volume, aggregation, retention
Analytics pipelineBatch vs stream, exactly-once, late data
Price scraperPoliteness, scheduling, change detection
ETL / data warehousePartitioning, columnar storage, backfill

#Search / ranking

PromptReally asking
Search engineInverted index, ranking, index sync
TypeaheadTrie with precomputed top-k, latency budget
Product searchFaceting, filtering, relevance tuning
Recommendation systemCandidate generation then ranking
Trending topicsSliding windows, approximate counting

#Geospatial

PromptReally asking
Uber / ride-hailingGeohash or S2, matching, location updates
Food deliverySame, plus multi-party state machine
Nearby / YelpSpatial index, radius query
Proximity alertsGeofencing at scale
Maps / routingGraph algorithms, precomputed contractions

#Infrastructure

PromptReally asking
Job scheduler / cronExactly-once execution, leader election
CI/CD systemQueues, isolation, artefact storage
Feature flag serviceLow-latency reads, gradual rollout
Config serviceConsistency, watch/notify, caching
Metrics & alertingTime-series storage, downsampling, rules
Service discoveryRegistry, health, propagation delay

#3 · Fifteen to actually do

In this order. Each adds something the previous ones did not.

#DesignAdds
1URL shortenerFramework, ID generation, cache-first
2Rate limiterAlgorithms, distributed counting
3News feedFan-out, hot keys, the canonical question
4ChatStateful connections, ordering
5TicketingStrong consistency, locking
6Photo sharingObject storage, CDN, presigned upload
7Web crawlerQueues, politeness, dedup structures
8TypeaheadLatency budget, precomputation
9Video platformPipelines, bandwidth economics
10File syncChunking, conflict resolution
11NotificationsThird parties, bulkheads, tiers
12Payment systemIdempotency, ledgers, reconciliation
13UberGeospatial indexing, matching
14Metrics systemTime-series, downsampling, cardinality
15Job schedulerLeader election, exactly-once execution

The bolded six cover most of the shape space. If you only do six, do those.


#4 · A four-week schedule

Week 1 — the method

DayDo
1Read the framework. Write the six phases from memory.
2Requirements & scope. Practise the opening on three prompts, out loud.
3Estimation. Memorise the numbers; do five estimates.
4Design #1 (URL shortener) — yourself first, then read.
5Design #2 (rate limiter).
6Building blocks: load balancing, caching.
7Rest, or redo design #1 from scratch.

Week 2 — blocks and the canonical designs

DayDo
8Queues & streams.
9Databases & indexes.
10Sharding + replication.
11Design #3 (news feed) — the big one.
12Redo #3 from a blank page. Compare.
13Design #4 (chat).
14CDN & object storage; design #6 (photo sharing).

Week 3 — the hard parts

DayDo
15CAP & consistency models.
16Idempotency.
17Design #5 (ticketing) — strong consistency.
18Failure & resilience.
19Design #12 (payments).
20Observability; add monitoring to two earlier designs.
21Mock interview. Non-negotiable.

Week 4 — fluency

DayDo
22–25One design per day, timed at 45 minutes, out loud, standing
26Anti-patterns; review your recordings for them
27Second mock
28Checklist and numbers only. No new material.

#5 · How to practise alone

Rehearsal has to look like the round or it does not transfer.

[ ] Set a 45-minute timer. Do not pause it.
[ ] Stand at a whiteboard or use a blank digital canvas. Not an editor.
[ ] Speak out loud the entire time. Record yourself.
[ ] Do NOT look anything up mid-design.
[ ] Afterwards, listen back and mark:
      - did you scope before designing?
      - did an estimate change a decision?
      - can you trace each choice to a requirement?
      - did you go three levels deep anywhere?
      - did you volunteer a weakness?
      - how much dead silence?

Listening back is uncomfortable and it is the highest-value thirty minutes in the whole schedule. You will hear filler, hedging, and unjustified choices that you had no idea were there.

Then read the write-up and mark only where you differed and why. Places you matched teach nothing.


#6 · Judging yourself

SignalWhere you are
Cannot start without the framework in front of youKeep drilling the framework
Can produce a design but not defend the choicesPractise "why not the alternative?" on every decision
Can defend choices but run out of timeTimebox scoping harder; be drawing by minute 13
Reach the deep dive with time leftReady — now add depth on one component
Volunteer weaknesses unpromptedInterviewing above the bar