Designing Data-Intensive Applications
The reference for replication, partitioning, transactions and consistency. If you read one book, read this one, chapters 5 to 9 first.
How the hour runs, what the interviewer writes down, and a step-by-step method to fill it: scope, numbers, an end-to-end design, two or three deep dives, a failure walk and a clean finish. The other labs are the depth; this one is how to deliver it under a clock.
You get a deliberately vague prompt ("design a metrics store") and 45 or 60 minutes with an engineer who plays a mix of product owner and skeptical colleague. There is no right answer to find. The interviewer is sampling how you work: how you turn an unclear ask into a scoped problem, whether your design works end to end, how deep you go where it matters, and how you reason about the trade-offs you make on the way.
| Part | Of 60 min | What happens |
|---|---|---|
| Introductions | 0–5 | Two sentences about you. Don't spend it; the design clock is what counts. |
| Design | 5–50 | You drive. The interviewer answers questions, adds constraints, and steers toward the areas they want to probe. |
| Your questions | 50–60 | Ask about the real system and team. Good questions are a final signal of how you think. |
Many companies run 45 minutes with roughly 35 of design. The pacing section has plans for 35, 45 and 60 minutes of design time.
| Variant | Example prompt | Shift your time toward |
|---|---|---|
| Product design | News feed, ride matching, chat, ticket booking | API, data model, read path, caching, fan-out. More boxes, each one shallower. |
| Infrastructure design | Rate limiter, distributed log, metrics store, job scheduler, multi-tenant query service | Mechanism: partitioning, replication, the ack point, consistency, failure handling. Fewer boxes, much deeper. |
| Your own system | "Walk me through something you built" | Decisions you owned, the alternatives, what broke. See section 10. |
| Design critique | "Here's our design. What's wrong with it?" | The failure walk and the numbers. Find where it breaks first, then fix the worst one. |
| Component deep dive | "How does replication work in X? What does a SELECT see?" | Pure depth. This is where the other labs pay off. |
At a database or infrastructure company, expect the infrastructure variant and expect the interviewer to push on storage, replication, consistency and multi-tenancy. Lab 06 is a full worked answer in that shape.
Rubrics differ by company but nearly all reduce to these six. Each is graded on evidence: something you said or drew. A strong signal you never voiced doesn't count.
| Dimension | Strong signal | Weak signal |
|---|---|---|
| Problem navigation | Scopes in minutes. Asks questions whose answers change the design. Finds the hard part and says so. | A checklist of questions it never uses again. Or no questions, straight to boxes. |
| Solution design | A working end-to-end design early. Each component has one job and a reason to exist. The data flow is traced. | Box soup. A component nobody can explain. A design that misses a requirement it agreed to. |
| Technical depth | Goes two or three levels down where it matters. Knows mechanisms and rough numbers. | "Use Kafka", "add a cache", "shard it" with no how, no why and no cost. |
| Trade-offs | Names the alternative, picks one with a reason tied to a requirement, says what would change the choice. | One option as if it were the only one. "It depends" without resolving it. |
| Operational maturity | Failure modes, detection, rollout, migration, cost. Would you trust this person on call? | Happy path only. "We'll add redundancy." |
| Communication | Signposts, checks in, uses hints, keeps the board readable. | Monologue or long silence. Treats hints as attacks. |
Use the same seven steps for every prompt. They're not a script to read out loud. They exist so that under pressure you always know what comes next, and so that each rubric dimension gets evidence before the hour ends.
The interviewer agrees with the list. Ask: "Is this the right slice, or is there something you specifically want to see?"
Designing for every feature. Scope is a decision you make, not a list you collect.
You can finish the sentence "the hard part of this problem is…". That sentence decides your deep dives.
Ten minutes of arithmetic that never affects a choice.
Every functional requirement maps to an operation, and every operation maps to an access pattern the data model serves.
Full schemas, REST naming debates, auth headers.
A simple version meets every functional requirement. It may still miss the hard non-functional one; that's what the next step is for.
Optimizing before the design works. Boxes with no arrows.
The weak point in the high-level design is fixed and you've shown you know how the fix works inside. See section 07.
Going deep on the easy part because it's the part you know.
Each failure has a detection signal and a bounded blast radius.
Skipping it because time ran out. Keep at least five minutes.
The interviewer could repeat your design to the hiring committee from your summary alone. That's literally what they're about to do.
Most failed interviews ran out of time in the wrong place: twenty minutes on requirements and no deep dive, or a perfect deep dive and no failure walk. Decide the budget before you start and check the clock at every step boundary.
Run a mock against the plan. Press Next step each time you move on; at the end you get your actual splits against the budget. The clock shows the cues for the step you're in.
A good clarifying question is one where different answers lead to different designs. "How many users?" earns its place only if you then say what changes at 10× more. Ask fewer questions, and make each one count.
Write non-functional requirements so someone could check them. Each one should name an operation, a number and a condition.
| Vague | Testable |
|---|---|
| Fast | Read by key: p99 < 50 ms at 100k req/s peak. |
| Highly available | 99.95% monthly for reads; survives loss of one AZ with no manual action. |
| Durable | A write is never lost after the ack, which waits for 2 of 3 replicas in different AZs. (Ack after what: lab 02.) |
| Consistent | Users read their own writes; other users may lag by up to 5 s. (Which models: lab 04.) |
| Real time | Event to queryable: p99 < 10 s. |
| Cheap | Storage cost near object-storage prices; compute scales to zero when idle. |
Estimation is graded on whether you reach the right order of magnitude quickly and then use it: "about 2 TB a day, so a single node is out and we're partitioning from the start." Round hard, say your assumptions, and move on.
| SLO | Per month | Per year |
|---|---|---|
| 99% | 7.3 h | 3.65 days |
| 99.9% | 43.8 min | 8.77 h |
| 99.95% | 21.9 min | 4.38 h |
| 99.99% | 4.4 min | 52.6 min |
| 99.999% | 26 s | 5.3 min |
Serial dependencies multiply: three 99.9% services in series give about 99.7%. Four nines with manual failover is not credible; it needs automation.
| Operation | Roughly |
|---|---|
| Main memory reference | 100 ns |
| Read 1 MB sequentially from memory | 50–100 µs |
| NVMe random 4 KB read | ~100 µs |
| Read 1 MB sequentially from NVMe | 0.3–1 ms |
| Round trip, same AZ | 0.1–0.5 ms |
| Round trip, across AZs in a region | 0.5–2 ms |
| Network block storage write | ~1 ms |
| Consensus write, 3 replicas across AZs | 2–10 ms |
| Object storage GET, first byte | 10–50 ms, tail 100+ |
| Round trip, US east to west | 60–70 ms |
| Round trip, transatlantic | 70–100 ms |
| Thing | Roughly |
|---|---|
| Stateless service, per core | 1k–10k req/s |
| Cloud NIC | 10–100 Gbit/s |
| NVMe drive, sequential | 2–7 GB/s |
| One relational primary, small writes | 10k–50k/s |
| One in-memory cache node | 100k–1M ops/s |
| One Kafka partition (plan with) | ~10 MB/s |
| ZooKeeper or Keeper ensemble writes | ~10k/s, one leader |
| Columnar scan, simple aggregate | ~1 GB/s per core |
| S3, per prefix | 3,500 PUT/s · 5,500 GET/s |
These are orders of magnitude for planning, not benchmarks. In the room, say "roughly" and show the reasoning; nobody grades the third significant figure.
Practice the standard chain: clients → requests → peak → bandwidth → storage → nodes. Then read the sentence at the bottom out loud; that's the version you say in the interview.
The interviewer will photograph or copy your board into their notes. Lay it out so that someone who wasn't in the room can follow it: requirements and numbers on the left, the architecture in the middle, the deep dive on the right.
POST /events {batch, idempotency_key}, GET /feed?cursor=.Once the boxes are up, walk one write and one read through them, numbered on the board. It proves the design works, exposes missing pieces before the interviewer finds them, and gives you natural places to say "this is where it gets hard".
The high-level design shows you can build something. The deep dive shows your level. Choose topics where the hardest requirement bites, and go two or three levels down: not "use consistent hashing" but how a key moves when a node joins, what happens to in-flight writes, and how long rebalancing takes.
| Pressure in the requirements | Decision to make | Real options | Depth |
|---|---|---|---|
| Data or traffic exceeds one node | Partitioning | Hash vs range vs directory; resharding; hot keys and splitting | · |
| Survive node or AZ loss | Replication and the ack point | Sync vs async; leader vs leaderless; quorum sizes | 02 · 04 |
| One writer, leases, membership | Coordination | Consensus service (Raft, ZooKeeper, Keeper); fencing tokens | 00 · 08 |
| Atomic change across partitions | Commit protocol | 2PC, sagas, single-partition design, outbox | 00 · 08 |
| Ordering, dedup, unique IDs | IDs and clocks | Snowflake-style IDs, HLC, per-partition sequences | 01 |
| No lost or doubled effects | Delivery semantics | At-least-once plus idempotency keys; transactional outbox | 02 |
| Freshness vs correctness | Consistency model | Linearizable, read-your-writes, bounded staleness, eventual | 04 |
| Write-heavy or analytical | Storage layout | B-tree vs LSM; row vs columnar; immutable parts plus merges | 05 · 06 |
| Cheap durable storage | Object storage | Local disks vs S3; caching tiers; request amplification | 05 · 06 |
| Shared by tenants | Isolation and fairness | Quotas, weighted fair queueing, admission control, cells | 03 |
| Bursty load | Backpressure and shedding | Bounded queues, token buckets, 429 with retry-after, priorities | 02 · 03 |
| Read latency | Caching | Cache-aside vs write-through; invalidation; stampede protection | · |
| CPU-bound hot path | Concurrency | Thread pools, lock contention, batching, lock-free structures | 07 |
| Global users | Multi-region | Active-passive; active-active with conflict resolution; residency | 04 |
Walk the same list for every design, in order. For each failure, answer three questions: what does the user see, how do we detect it, and what limits the blast radius? The list is what makes it fast; you don't have to invent failure modes under pressure.
The interviewer can only grade what they heard. Thinking out loud, signposting and checking in turn your reasoning into evidence. Rehearse these until they come out without effort, then use your own words.
| Mid-level | Senior | Staff and above | |
|---|---|---|---|
| Scope | Accepts the scope given, asks reasonable questions | Narrows scope quickly and names the hard part | Reframes the problem when the prompt hides a better one; asks about the business constraint |
| Design | A working design, with some prompting | A working design unprompted, sound component choices | Several viable designs compared; picks by cost, risk and team |
| Depth | One area in depth when asked | Two or three areas, including failure behavior | Finds the deep problem before the interviewer does; numbers throughout |
| Trade-offs | Knows the standard ones | Ties them to requirements | Ties them to evolution: migration, operability, cost in two years |
| Driving | Follows the interviewer | Drives, takes direction well | Drives the whole hour; the interviewer mostly listens and probes |
Some loops replace or follow the design round with a deep dive on your own work. It's graded on the same dimensions, plus ownership: which decisions were yours, what you'd change, and whether you understood the system below the layer you touched. The interviewer will drill until you say "I don't know". Prepare so that happens late.
What the system does, for whom, and why it mattered. One sentence of business, one of technology.
Your role in it: "I designed and led…", "I owned the storage layer…". Be exact; they will check.
Scale, latency, team size, deadlines, the legacy you inherited.
Have four or five real numbers ready: rows per second, p99, cost, nodes, data size.
One diagram you can draw from memory in three minutes. Walk a request through it.
Mark the parts you built and the parts you used.
For each: the options you had, why you picked one, what it cost, and whether you'd make the same call today.
This is the core. It's where trade-off reasoning gets graded.
An incident or a design that didn't survive contact with production. How you found it, what you changed, what you measured after.
Good stories end with a change to the system and to how the team works.
Numbers before and after.
What you'd do differently now. Saying "nothing" is a red flag.
Reading designs doesn't build the skill; producing them out loud under a clock does. This section is tuned for one specific round, a deep technical discussion on distributed systems and cloud OLAP, and the generic plan follows it.
A discussion-driven round: a few questions on two-phase commit, then "design an OLAP database in the cloud". Along the way it ranges over the topics below. It's graded on reasoning and trade-offs, with clear structure and depth of thought counting for more than coverage. ClickHouse internals help, but it isn't a trivia quiz: explain the mechanism first, then name the ClickHouse feature that implements it.
| Topic | What they'll probe | Can you answer this in two minutes? | Depth |
|---|
| When | Focus | Do |
|---|---|---|
| Three days out | Find the gaps | Run the quick-fire drill below, out loud, before opening any answer. Mark every question you couldn't answer in two minutes and read that lab section. Learn the numbers in section 05. |
| Two days out | The full mock | Run the This round plan on the clock, with a friend or recorded: 2PC questions, then the OLAP design. Score it. Redo your two weakest deep dives on paper. Write down one real debugging story: symptom, wrong first hypothesis, the measurement that cracked it, the fix. |
| The day before | Keep it light | One more timed OLAP design at 35 minutes. Reread lab 06's architecture and lab 08's follow-ups. Stop by early evening and sleep. |
| The morning of | Warm up | Fifteen minutes out loud: 2PC and where it blocks, then the cloud OLAP architecture in three sentences. Then the day-of checklist. |
Say your answer out loud before you open it. Each answer is the short version: the claim, the mechanism, the trade-off. The lab link is the long version.
| Week | Focus | Do |
|---|---|---|
| 1 | Method and fundamentals | Learn the seven steps and the numbers. Read labs 02, 04 and 01. Two solo prompts on the clock, recorded. Watch the recording once and score it. |
| 2 | Depth | Labs 00, 05, 03, 08 and 07. Three prompts on the clock. For each, write the deep dive out in full afterwards: options, choice, mechanism, failure. Prepare your own-system story. |
| 3 | Mocks | Three or four full mocks with someone who pushes back. Do lab 06 as a mock, then compare. Fix the lowest-scoring rubric dimension each time. Rest the day before. |
Daily, ten minutes: estimate one thing out loud ("how many bytes does this site's analytics store per year?") and explain one mechanism in two minutes ("how does Raft elect a leader?").
Fill it in after each mock, from the recording if you have one. Your ticks are saved in this browser only.
The reference for replication, partitioning, transactions and consistency. If you read one book, read this one, chapters 5 to 9 first.
How to pick SLIs and SLOs and what an error budget buys you. The vocabulary for your non-functional requirements and your failure walk.
Short, concrete articles on timeouts, retries with jitter, load shedding, shuffle sharding and static stability. Ideal material for the failure walk.
The classic table, with a slider for the year. Use it to sanity-check the latency column in section 05.
Where the per-prefix request rates come from, and how to design key layouts around them. Comes up in any design that stores data in object storage.