Most people fail a system design interview in the first two minutes. They start drawing boxes before they know what they are building. Then they add parts nobody needs and miss the real problem.
A fixed six-step order fixes this. It works for a URL shortener, a chat app, payments or a news feed. Every case study in this course follows it. It is built for high-level design rounds. Low-level design rounds use a different process, covered in the LLD interview approach lesson.
Understand the problem. Put numbers on it. Design the simplest system that fits those numbers. Then test the parts most likely to break. Every choice should come from a requirement, a number or a trade-off you can name.
1. What the Interviewer Is Judging
The final diagram matters less than how you got there. The interviewer looks for these things:
- Questions: you ask what the system must do before you design it, and you state your assumptions.
- Numbers: you estimate the load, and the result changes your design.
- Clear design: every part has one job, and you can show how data moves.
- Depth: you can explain how a part works inside, and what happens when it fails.
- Trade-offs: you compare options, pick one, and say what it costs.
- Communication: you think out loud, check in often, and change the design when the facts change.
The bar goes up with level. Exact expectations differ by company, but this is typical:
- Mid-level: a working design from start to end, with sensible numbers.
- Senior: trade-offs with reasons, plus two real deep dives, for example on concurrency or failure.
- Staff: you also frame the problem, set priorities, compare whole architectures and plan how the system grows.
2. The Six Steps
Each step answers one question and leaves one result on the board.
flowchart LR
A["1. Requirements"] --> B["2. Estimation"]
B --> C["3. API"]
C --> D["4. Data model"]
D --> E["5. High-level design"]
E --> F["6. Deep dives"]
F -. "new constraint found" .-> B
F -. "access pattern changes" .-> D
E -. "component not justified" .-> A
| Step | Question | Result on the board | Minutes (of 45) |
|---|---|---|---|
| 1. Requirements | What are we building, for whom, and how well? | What is in scope, what is not, and 3 to 5 quality targets as numbers | 5 |
| 2. Estimation | How big is it? | Requests per second, storage and bandwidth, each with a conclusion | 5 |
| 3. API | How do clients use it? | Operations, key fields, errors, and whether a retry is safe | 8 (steps 3 and 4 together) |
| 4. Data model | What do we store, and how do we read it? | Entities, access patterns, keys and indexes | included above |
| 5. High-level design | Which parts do we need, and how does data move? | A small diagram with the read and write paths marked | 10 |
| 6. Deep dives | Will it survive heavy load, many users at once, and failures? | How the 2 or 3 riskiest parts work, and their trade-offs | 14 |
| Wrap-up | What are the limits, and what comes next? | A short summary and the known risks | 3 |
For a 30-minute round, use 3, 3, 5, 7, 9 and 3 minutes. For 60 minutes, use 5, 6, 10, 12, 22 and 5. A short round makes each step shorter. It never skips a step. Even in 30 minutes, state your quality targets and one main estimate.
The steps are a line of thought, not strict phases. A number from step 2 may change your data model. A failure you find in step 6 may change the architecture. Going back is fine. Just say why.
3. What to Do in Each Step
3.1 Step 1: Requirements
"Design a URL shortener" is vague on purpose. Turn it into a clear scope before you draw anything. Ask your questions in groups. Offer a default so the interviewer only has to confirm it: "I will assume 20 million new links a day, mostly reads, with fast redirects. Tell me if that is wrong."
- What it does: the three or four most important operations, and what you leave out.
- How big it is: users, requests per day, growth, and whether it is read-heavy or write-heavy.
- How well it works, as numbers: say "redirect p99 under 50 ms", not "fast". Also ask about availability, whether a read may be out of date, and whether an acknowledged write may ever be lost.
These quality targets shape the architecture. A payment system must be correct above all. A social feed can show slightly old content to stay fast. The Requirements and Scope lesson covers this in full.
3.2 Step 2: Estimation
You only need the rough size. Is it hundreds of requests per second, or hundreds of thousands? The answer tells you if one database is enough, if you need a cache, and what work can run in the background.
State your assumptions. Round the numbers up. End each estimate with "so what?". A number that changes your design is useful. A number you calculate and never use is wasted time.
Two shortcuts do most of the work:
- Start with totals per day. Requests per day divided by 86,400 (or by 100,000 for a quick estimate) is about requests per second.
- Peak traffic is usually 2 to 10 times the average. Use 4 unless you are told otherwise, and say so.
The Numbers and Capacity Estimation lessons cover the rest.
3.3 Step 3: API
The API turns requirements into operations. It also raises questions that shape your data. For each operation, decide:
- Is it a read or a write?
- Is a retry safe? If not, add an idempotency key.
- Does it return a list? If so, how is it paged and sorted?
- Which errors can it return?
- Who is allowed to call it?
REST, GraphQL or gRPC matters less than a clear contract.
3.4 Step 4: Data Model
Start from access patterns, not from nouns. An access pattern is how the data is read or written, for example "get a link by its code, 92,000 times a second". Then follow these rules:
- Choose keys so the most frequent pattern is a lookup by one key.
- Add an extra index only when a pattern needs it. Every index slows down writes.
- Pick the database by pattern. Use key-value or wide-column stores for simple lookups at large scale. Use a relational database when you need transactions, constraints or flexible queries.
- Keep derived data, such as counters, in separate tables. You can rebuild it, and it stays off the busy main row.
3.5 Step 5: High-Level Design
Start with the simplest design that meets the requirements. Add a part only when a requirement or number calls for it, and say which one. "Reads peak at about 92,000 per second, so I add a cache" is a decision. "Add a cache" is just decoration.
Then walk through the read path and the write path out loud. This shows the weak spots, such as a burst of cache misses or a queue that goes down. Those weak spots become your deep dives.
3.6 Step 6: Deep Dives
Pick the two or three areas most likely to break, or the ones the interviewer asks about. For each one, state the problem, the fix, the trade-off, and how you would notice a failure.
Choose what is hard about this problem. A generic topic like "let's talk about sharding" wastes your best minutes. These are typical choices:
- Read-heavy lookup (URL shortener): cache hit rate, unique ID generation, cache invalidation.
- Feed or timeline: fan-out, and the load from accounts with millions of followers.
- Notifications and messaging: delivery guarantees, retries, limits set by outside providers.
- Payments: idempotency, duplicate prevention, ledger correctness, reconciliation.
- Files and media: chunked upload, delivery cost, edit conflicts.
- Live location or matching: heavy write traffic from moving clients, geospatial lookups.
- Distributed data store: partitioning, replication, consistency, failure detection.
4. Worked Example: A URL Shortener in One Table
This table shows what each step leaves on the board. The full design, with its deep dives, is the URL shortener case study later in the course.
Assumptions: 20 million new links a day, 100 reads for every write, 5 years of retention, 500 bytes per record. For servers, assume Java on Apache Tomcat on AWS m5.xlarge instances. Each one handles about 2,000 simple requests per second.
| Step | What goes on the board | What it tells us |
|---|---|---|
| 1. Requirements | In scope: create, redirect, deactivate, basic click counts. Out of scope: custom domains, dashboards. Targets: redirect p99 under 50 ms, 99.99% availability, analytics may be a few minutes late | Redirects matter most. Analytics can run in the background |
| 2. Estimation | 20M ÷ 86,400 seconds in a day is about 231 writes/s. Reads are 100 times that: about 23,100/s on average and 92,400/s at the 4x peak. Records: 20M × 365 × 5 = 36.5 billion, about 18 TB | Read-heavy, small writes, 18 TB of storage. One primary handles the writes. Reads need a cache |
| 3. API | POST create (with an idempotency key, returns 201). GET redirect (302, or 404 and 410 on errors). DELETE deactivate | A retried create must not produce two codes |
| 4. Data model | One table keyed by short code, because that is the most frequent lookup. An index on user and creation time. Click counts in a separate table | A redirect is one primary-key lookup. No busy counter on the main row |
| 5. High-level design | Load balancer, about 46 stateless app servers (92,400 ÷ 2,000), cache, database with replicas, event log for clicks | A 90% cache hit rate cuts database reads from 92,400/s to about 9,200/s |
| 6. Deep dives | Unique code generation, 301 versus 302 and cache invalidation, analytics that do not slow redirects, a cache node failing | These are the places where the design can break |
5. How to Talk
A good design is wasted if the interviewer cannot follow it.
- State assumptions and ask for a check. Say "I will assume 20 million new links a day. Is that the right size?" Do not ask "how big?" and then wait.
- Check in after each step. Ask "Does this match what you expected?" This stops you from talking for ten minutes in the wrong direction.
- Explain every trade-off in the same order. Name the options, the requirement or number that decides, your choice, and its cost. Example: "For redirects I can use 301 or 302. We need click analytics and the ability to deactivate links, so I choose 302. The cost is that every click reaches our servers. That is 92,400 requests per second at peak, which we already planned for."
- Treat "what if X fails?" as a hint. The interviewer is pointing at a weak spot. Name the failure, its effect, the fix, and how you would detect it.
- Listen to hints. If the interviewer suggests another approach, compare it fairly against the requirements. Use it if it is better. Defending your first sketch at all costs is a bad sign.
- Admit what you do not know. Use a stated assumption: "I will assume a primary handles 10,000 writes per second." Or describe the property you need and the kind of tool that has it. Do not bluff.
- Keep the diagram small. Draw left to right and label the arrows with what flows. Put extra detail on a second diagram for the deep dive.
6. Common Pitfalls
- Drawing too early. Boxes appear in the first two minutes. Spend the first five minutes on scope and targets.
- Numbers that go nowhere. You estimate, then never use the result, or your assumptions disagree with each other. End each estimate with a design decision, and keep assumptions consistent.
- Name-dropping tools. Saying "Kafka, Redis, Cassandra" with no reasons. Say what you need first, then name the tool.
- Wide but shallow. Many parts, but no explanation of how any of them works. Choose two or three deep dives and go deep.
- Too much too soon. Sharding and microservices for 231 writes a second. Start simple. Add complexity only when a number requires it.
- Only the happy path. Ask of every part: what if it is slow, down or wrong? Give a cost for every claim.
- Running out of time on the hard part. You are still on the API at minute 35. Watch the clock against the time plan.
7. Interview Questions This Lesson Prepares You For
- How do you approach a system design question you have never seen? Clarify the requirements and set quality targets. Estimate the scale. Define the API and the data model. Draw the simplest design. Then deep dive on the riskiest parts. Tie every choice to a requirement or a number.
- Why estimate before you design? The size decides what you need. 231 writes per second fit on one database. 400,000 do not.
- How do you choose what to deep dive on? Pick what makes this problem hard. For a feed it is fan-out. For payments it is idempotency. Also cover anything the interviewer points to.
- Halfway through, the interviewer says traffic will be 10 times higher. What do you do? Redo the affected numbers out loud. Find which part breaks first. Change only that part.
- What if you notice a mistake you made earlier? Say so briefly, fix it, and say what changes. Fixing your own mistake is a good sign.