Engineering Atlas › System Design Interviews

Mapping requirements to building blocks

15 min read · last reviewed 2026-10-17

Open in the interactive app: practice, quiz, mock interview →

In one minute

How it works

From signal to concept

Interviewers rarely say "use sharding". They say "200 million users, each posts a few times a day", and wait to see whether you notice the arithmetic has outgrown one machine. This table maps those signals to concepts and to the lessons that cover each in depth.

Signal you hear or computeConcept it triggersGo deeper
Reads at least 10x writes, staleness of seconds is fineCaching, read replicas, CDNCaching, Scaling Read Traffic
Peak writes beyond about 10k per second, or data beyond a few TBPartitioning and sharding, LSM storageScaling Write Traffic, Database Design
One key gets a large share of trafficHot-key splitting, request coalescingHandling Hot Keys
Traffic jumps 10x in seconds (sales, launches)Queues as buffers, admission controlAbsorbing Traffic Spikes
Work takes longer than a request should waitQueue plus workers, job stateHandling Long-Running Tasks, Scheduling Delayed and Recurring Jobs
One write must reach many readersFan-out on write or readFanning Out Updates
Others' changes visible within a secondPush (WebSocket, SSE)Pushing Real-time Updates, Networking
"Never charge or sell twice"Idempotency, conditional writesPreventing Duplicate Processing, Preventing Double Booking
One action spans several services or storesSagas, outbox, change data captureCoordinating Transactions Across Services, Keeping Data in Sync
Must survive losing a regionMulti-region replication and routingRunning Across Multiple Regions, Surviving Component Failures
Large blobsObject storage, presigned URLsUploading and Serving Large Files, Streaming Video and Audio
Find by text, prefix or locationInverted, trie or geo indexSearch and Typeahead, Finding and Tracking Locations
Count, rank or ID huge streamsSharded counters, sketches, ID schemesCounting at Scale, Data Structures, Generating Unique IDs

The five Concept Deep Dives sit underneath: Networking (what each arrow costs), Caching (the first tool for read load), API Design (requirements into an interface and access patterns), Database Design (access patterns into keys and partitions) and Distributed Systems (what happens when pieces disagree or fail). 30 Must-Know Concepts organises the same ideas by family; this chapter organises them by the signal that calls for them.

Rank before you explain

A 45-minute interview leaves about 10 to 20 minutes after the high-level design; one widely used framework budgets about 10 minutes for deep dives after roughly 20 to 30 minutes of requirements, API and high-level design (Hello Interview). A concept explained well, with mechanism, one number and failure mode, takes 4 to 7 minutes: two or three deep dives, not seven. Candidates who fail on depth rarely lack knowledge; they spend it on the wrong concept.

Rank the triggered concepts with three questions:

  1. What breaks the product if this is wrong? Double charges and lost messages outrank a slow profile page.
  2. What did the numbers force? At 40k writes per second, partitioning must appear and be justified.
  3. What is unusual about this problem? Caching shows up everywhere. The celebrity fan-out in a feed, the seat hold in ticketing or the merge in a collaborative editor is what the interviewer most wants to see.

Everything below the cut gets one sentence: "Static assets go through a CDN; happy to go deeper."

Concepts come with obligations

Each concept creates a question a strong interviewer will ask. A cache obliges invalidation and stampede handling, because cache-aside by itself guarantees no consistency with the database (Azure Architecture Center). Sharding obliges a key and a plan for cross-shard queries. A queue obliges duplicate handling, ordering and a dead-letter path; even a managed queue such as SQS standard only promises at-least-once delivery and tells you to make consumers idempotent (AWS docs). Replication obliges a statement of what a reader sees right after a write. Multi-region obliges conflict resolution. Budget the minute each obligation takes, or leave the box out.

Common mistakes

Down the stack

Layer 1The contract

Each concept is a promise you can state as a testable sentence; that is what makes it an answer rather than a buzzword. Caching: "a read may be up to 30 seconds old; a write deletes the key". Sharding: "queries with the user ID touch one shard; others scatter to all 64". Queueing: "every accepted job runs at least once, usually within 10 seconds, possibly twice". Idempotency: "a repeat with the same key within 24 hours returns the first result and does nothing else". The window is a design choice you must state: Stripe may prune keys once they are 24 hours old, while a DynamoDB transaction's client token is honoured for only 10 minutes. Replication: "a committed write survives losing any one node; followers lag by up to a second". If you cannot finish the sentence, do not propose the concept.

Layer 2The mechanism

Almost every concept is built from four primitives. Copy: replicas, caches, CDNs, materialised views and search indexes store one fact in several places. Split: partitioning, sharding and consistent hashing divide data or work across machines. Defer: queues, logs, batching and change data capture move work out of the request path. Agree: transactions, consensus (Raft in etcd, ZAB in ZooKeeper), leases and compare-and-set make several actors accept one outcome. An etcd cluster needs a majority to accept any update, so three members survive one failure and five survive two (etcd FAQ).

The primitive predicts the obligation. Copies go stale: you need invalidation or a staleness budget. Facebook's memcache fleet, one of the largest copies ever run, still needed leases to stop stale sets and herds (NSDI 2013). Splits break cross-partition operations: you need a key that matches the dominant query. Deferred work arrives late or twice: you need idempotent consumers and lag monitoring. Agreement costs round trips and needs a majority: keep the agreed state small. Consensus keeps working while any majority is up and stops, without losing correctness, when it is not. An unfamiliar concept such as a CRDT becomes easy to place: it is copy without agree, hence its merge rules.

Layer 3The machine

The thresholds come from hardware. A DRAM lookup costs about 100 ns and a round trip inside one datacenter about 0.5 ms (latency table), so a database query over the network costs 0.5 to a few ms, so a cache hit is worth one to two orders of magnitude. A relational primary with its WAL on NVMe sustains thousands to low tens of thousands of small transactional writes per second, bounded by fsync latency, lock contention and replication: hence the 10k trigger. A server holds tens of TB of SSD, but backups, index rebuilds and failover of a multi-TB database get painful long before the disk fills. A 10 Gbit NIC carries about 1.25 GB/s, so a hot key returning 10 KB values saturates one cache node at around 100k reads per second, before its CPU runs out. A cross-region round trip of 60 to 150 ms (California to the Netherlands and back is about 150 ms in the same table) is why synchronous agreement across regions is reserved for small, critical writes.

Why it's built this way

One machine has finite memory, disk, network and failure tolerance, so at some scale you copy or split. The pieces then sit on a network that is slow and sometimes broken, so keeping them in step costs time. Most user-facing work tolerates a little delay or staleness, so deferring and copying buy capacity cheaply. A few operations (money, inventory, identity) cannot, so agreement is spent only there. That uneven need for exactness is why designs mix concepts per operation, and why ranking them matters.

Diagram

flowchart LR
    R["Requirement or estimate"] --> S["Signal"]
    S --> P{"Primitive"}
    P -->|copy| C["Cache, replica, CDN"]
    P -->|split| H["Partition, shard"]
    P -->|defer| Q["Queue, log, fan-out"]
    P -->|agree| A["Transaction, consensus, CAS"]
    C --> O1["Obligation: staleness, invalidation"]
    H --> O2["Obligation: key choice, cross-shard"]
    Q --> O3["Obligation: duplicates, lag"]
    A --> O4["Obligation: latency, availability"]

Worked example

The prompt: ticket sales for a concert platform. You learn there are 20 million DAU browsing about 50 pages each per day, and big on-sales put 2 million people on one event page in the same minute for 50,000 seats. No seat may be sold twice and no payment taken twice.

  1. Reads: 20M × 50 / 86,400 is about 11,600 per second, read-heavy, with 10 seconds of staleness acceptable. That triggers caching and a CDN.
  2. On-sale: 2 million users refreshing one event every few seconds is hundreds of thousands of reads per second on one key. That triggers hot-key handling and spike absorption, typically a waiting room that admits users at a fixed rate.
  3. Seats: contention on 50,000 scarce items triggers double-booking prevention with a conditional write or an expiring hold.
  4. Payments: mobile retries trigger idempotency keys.
  5. At most 50,000 purchases per sale is a small write load, so sharding is not triggered. Say so; noticing what you do not need is a signal too.

With 18 minutes: the seat hold (correctness, unique, 7 minutes), the waiting room (forced by the numbers, 6 minutes), payment idempotency (4 minutes). Caching and the CDN get a sentence each. Each deep dive discharges its obligation: a hold expiring mid-payment, a refreshing user keeping their place, how long idempotency keys live.

In the wild

Trade-offs

StrategyStrengthsWeaknessesChoose when
Deep on two or three concepts, one line on the restShows real depth, fits the clockRisk of picking the wrong twoDefault; rank by damage, numbers and uniqueness
Broad tour of many conceptsShows vocabularyShallow, invites "how exactly?" probes you have no time forRarely; only for a quick early sketch
Start from the simplest design and add concepts only when a number forces themEvery concept is justifiedCan look slow if you over-explain the simple versionWhen you are unsure which concepts matter

Pitfalls in production

Leadership lens

Check yourself

  1. Your estimate shows 300 writes per second and 2 TB of data after five years. Does that trigger sharding?

    Show answer

    Not by itself. Both numbers fit one well-provisioned primary with replicas; say so, and name the threshold at which you would partition and the key you would use.

  2. Why does adding a cache oblige you to discuss consistency?

    Show answer

    A cache is a copy, and copies go stale. You must state how long a stale read may last and how writes invalidate or update the cached value.

  3. Your deep-dive budget allows three topics, and the problem triggers six concepts. How do you pick?

    Show answer

    Rank by the damage of getting it wrong, then by what the numbers forced, then by what is unique to this problem. Go deep on the top three and name the rest in a sentence each.

Sources and further study

Primary

Systems docs

Books

Other curricula

Watch

Free resources

Open in the interactive app: practice, quiz, mock interview →