InterviewKata
System design · Module 05 of 29 · Level 1: Foundations

The design method: from a vague problem to a defended design

"Design a chat app" is deliberately vague. The skill isn't knowing the answer; it's turning vagueness into a working design in a fixed order, so you never stall and never forget a piece. The same steps structure a design document at work and a 45-minute interview. Every worked design on this site follows them.

1. The idea

An architect asked for "a house" doesn't start drawing walls. They ask who'll live there and what they need (the brief), how big and what budget (the numbers), which rooms (the parts), where the doors go (how you move between them), then sketch a floor plan. Only then do they call the structural engineer about the long span over the kitchen: the hard part.

A design moves from what to how, and from broad to deep:

  1. Frame the problem. Ask the few questions whose answers change the design: who uses it, the biggest scale, what must never go wrong, what's out.
  2. What it must do. The three things users or clients can do ("a reader can open a paste by its link"). List the rest as "not now", with a reason.
  3. How well it must do it. Measured targets: scale, speed, consistency or availability, data safety, security. "A paste loads in under 200 ms at p99", not "fast".
  4. Numbers that change the design, and only those: every estimate ends "→ so we…" (Module 03).
  5. The nouns. The main things the system stores and moves: Paste, Link, User. A short list; fields come later.
  6. The contract. The few endpoints that serve the features, usually REST, with the caller's identity from the auth token. Add a data flow for pipelines.
  7. First working version. Boxes and arrows that make each endpoint work, one request at a time. Simple first; a working system before a clever one. Keep a "parked for later" list.
  8. Make it hold up. Go back to your targets and the parked list, and harden the design: scale, hot spots, failures, consistency, edge cases.
  9. Follow-ups and wrap-up. Answer the interviewer's "what if" questions, then summarise the trade-offs, what you'd monitor, and what you'd change at 10× scale.

The order matters because each step feeds the next: the features decide the contract, the contract decides the components, and the targets decide which deep dives matter. Skipping ahead is how designs end up solving the wrong problem. (Other guides often call steps 2 and 3 "functional" and "non-functional requirements"; it's the same idea.) The interview framework page turns these steps into a minute-by-minute playbook.

2. How it works

Press Play to watch the method produce a complete design for Pastebin: a service where users paste text and get a short link to share it. Each frame adds one section to the whiteboard.

What good looks like, step by step

StepGoodNot good
What it must do"Users can create a paste and get a link; anyone with the link can read it; pastes can expire."Fifteen features including syntax highlighting, folders and comments
How well"Reads under 200 ms p99; 99.9% available for reads; a created paste is never lost; 100:1 reads to writes.""Scalable, fast and reliable"
Numbers"~10 writes/s, ~1,000 reads/s, ~20 TB in 5 years: one DB for metadata, content in blob storage."Ten minutes of arithmetic that changes nothing
ContractPOST /pastes, GET /pastes/{id}POST /createPaste?userId=42 (an action, and identity from the client)
First versionA working path for each endpoint, with the main tables' key fieldsEvery box you know, with no data flow
Make it hold upThe 2–3 hardest problems, each with options and a choicePolishing the easy parts; never reaching the hard ones

3. Try it yourself

Requirements sorter

The prompt is "Design a ticket booking site for concerts." Sort each statement. Your choice locks in and the explanation appears.

Plan your 45 minutes

Interviews run 35 to 90 minutes. Pick a length to see a sensible time budget. Leave making it hold up the most room: that's where seniority shows. The framework page has the full nine-phase planner.

4. Trade-offs

Breadth before depth

A complete simple design beats half of a brilliant one. Get every requirement working end to end first, then go deep where the risk is.

Simple first, complexity on demand

Start with one database and stateless servers. Add caches, queues and shards only when a requirement or a number forces you to, and say which one.

Lead, but listen

Drive the conversation and propose the deep dives yourself, but stop when the interviewer (or a reviewer) steers you: their question is usually the thing they need to see.

Commit, then revisit

Make a decision with a stated reason and move on. If a later step shows it was wrong, change it out loud. That's good engineering, not a failure.

5. In real work and interviews

At work, the same steps become a design document: context and goals, explicit non-goals, the proposed design, alternatives considered and why they lost, risks, and a rollout plan. The doc is reviewed before code is written, because changing a box on paper is cheap and changing it in production isn't. Important decisions are often recorded as short architecture decision records (ADRs) so the reasons survive after the people move on (Module 28).

In interviews, the problem is either a product ("design a ride-hailing app") or infrastructure ("design a rate limiter"), drawn on a shared virtual whiteboard. Practise on the same kind of tool beforehand. Whatever words a company's rubric uses, it scores the same four things:

CompetencyWhat they want to seeHow people fail
Problem navigationBreaking the problem down, prioritising, driving to a working designSkipping requirements, polishing trivia, no working system at the end
Solution designSound building blocks that fit together and meet the requirementsIgnoring scale; tangled designs; components without a purpose
Technical depthKnowing current technology and patterns, and their limitsOutdated assumptions; buzzwords without the trade-off behind them
CommunicationClear explanations, good questions, taking feedback wellMonologues, defensiveness, getting lost in detail

Expectations rise with level. Mid-level: a complete, sound design with the interviewer guiding the deep dives (roughly 80% breadth, 20% depth). Senior: the basics done quickly, two or three deep dives you choose and lead (60/40). Staff and above: you shape the problem itself, anticipate failure modes and operations, and go deep on what matters most (40/60).

The interview up close

The default answer in an interviewUse one fixed structure every time (the interview framework): it keeps you moving and gives you a path back when you get lost. The top reason candidates fail isn't a wrong answer; it's not delivering a working system.

Non-functional checklist (pick the top 3–5 that matter for this system, each with a number): consistency vs availability (CAP) · environment limits (mobile, bandwidth, memory) · scalability (bursts, read:write ratio) · latency · durability · security · fault tolerance · compliance.

Expect probing. Interviewers doubt your answers and push on trade-offs to tell understanding from memorised solutions. "Why not X?" isn't a sign you're wrong; it's the test. Answer with the trade-off, and change your mind gracefully if they show you something you missed.

Deep dives: seniors find and lead them ("the hard part here is double-booking; let me go deep on that"); juniors can expect the interviewer to point. Leave room for their questions: talking over them misses the signals they want and costs you on communication.

🚩 Red flags interviewers notice
  • No working system at the end: the most common reason for failing. Get every endpoint working end to end before polishing anything.
  • A long feature list instead of the top three, or vague targets ("low latency") instead of numbers.
  • Estimates that change nothing. Do math only when it decides something.
  • Naming technology you can't defend. QUIC, GraphQL, Kafka, Cassandra, Temporal, a service mesh: each invites follow-ups. Use the boring default, and raise a specialised tool only when a requirement calls for it and you can explain how it works and what it costs. Each "up close" block on these modules lists those follow-ups.
  • Outdated assumptions: 2015-era hardware, sharding on day one, "MongoDB has no transactions".
  • Getting defensive when challenged, or getting lost in details nobody asked for.

Non-functional requirements, each with a number

The default · top 3–5 per design

Non-functional requirements say how well the system must work. Each one is only useful with a number attached, and each number changes the design.

How it works

QualityAskExample targetWhat it changes
ScaleUsers, requests a second, read:write ratio, peaks?50M daily users, 100:1 reads, 3× peakCaching, replicas, sharding
LatencyWhich operation, which percentile?Feed loads in p99 < 300 msPrecomputation, caches, CDN, regions
AvailabilityHow much downtime is acceptable?99.95% (≈ 22 min a month)Redundancy, multi-zone, failover (Module 04)
ConsistencyCan users ever see stale or conflicting data?Bookings: never double-sold; likes: seconds stale is fineTransactions vs eventual consistency (Module 16)
DurabilityCan we ever lose an acknowledged write?Payments: never; analytics: some loss OKSynchronous replication, backups
FreshnessHow soon must changes show?New posts visible within 5 sPush vs pull, cache TTLs
Security and privacyWho may see what? Any regulations?GDPR, data stays in the EUAuth, encryption, data placement (Module 26)
Cost and constraintsBudget, mobile networks, team size?Works on 3G; small teamPayload size, managed services

Status today

The same list appears in every interview guide; what separates candidates is choosing the few that matter for this system and attaching numbers.

Use it when

  • The first 5 minutes of every design: pick 3–5 and write them on the board

In the interview

The three that matter here: no double-booking (strong consistency on seats), p99 under 500 ms for search, and 10× spikes when a popular event opens.

🚩 Red flags
  • "Highly available, scalable, low latency" with no numbers.
  • Requirements that never come back in the design.

Drawing the design: the C4 model

Situational · diagrams at the right zoom

A simple way to draw architecture at four zoom levels (Simon Brown's C4 model): Context (the system, its users and other systems), Containers (apps, services, databases, queues: separately running things), Components (the main parts inside one container) and Code.

How it works

  • In an interview, draw containers: clients, load balancer, services, caches, databases, queues and object storage, with arrows labelled by what flows (POST /orders, OrderPlaced event).
  • Zoom in only for the deep dive: a components view of the one service that holds the hard problem.
  • Rules that keep diagrams readable: every box says what it is and its technology; every arrow has a direction and a label; reads and writes are drawn as separate paths when they differ.
  • At work: diagrams as code (Structurizr, Mermaid, PlantUML, D2) live next to the code and are reviewed like it.

Status today

Widely used for design documents; the interview whiteboard is effectively a C4 container diagram.

Use it when

  • The high-level design step
  • Design documents and onboarding

In the interview

Let me draw the containers first, then zoom into the booking service for the deep dive.

🚩 Red flags
  • Unlabelled arrows: the interviewer can't tell reads from writes.
  • Boxes named "backend" doing everything.

How interviews are usually scored

Know the rubric

Most companies score system design interviews against a handful of signals, and expect more of them as the level rises. Knowing the rubric tells you where to spend your 45 minutes.

How it works

SignalWhat they look for
Problem navigationClarifies scope, picks the important requirements, keeps moving
Solution designA working end-to-end system that meets the requirements
Technical depthGoes deep on the hard part, knows how the chosen pieces really behave
Trade-offsNames alternatives and why one wins here; changes course when shown a gap
CommunicationClear structure, thinks aloud, listens to hints
LevelTypical expectation
Mid-levelA sound working design; deep dives can be interviewer-led
SeniorLeads the deep dives, spots bottlenecks unprompted, justifies trade-offs with numbers
Staff and aboveFrames the problem, questions requirements, weighs operations, cost, evolution and team impact

Status today

The exact wording differs by company, but these signals are near-universal. Rubrics reward a complete design with one or two strong deep dives over an unfinished, perfect corner.

Use it when

  • Planning your time: about 5 min requirements, 10 high-level design, 20 deep dives, 5 wrap-up and questions

In the interview

I have a working design end to end; the riskiest part is the fan-out on write, so I'd like to go deep there unless you'd prefer another area.

🚩 Red flags
  • No end-to-end design at the 25-minute mark.
  • Not offering a deep dive at senior level and above.

6. Remember it

Memory hook: "Requirements before rectangles"No boxes until you know what users do and how well it must work. Then breadth before depth: a working design first, the hard parts second.
How this hook works: what "Requirements before rectangles" means

What the slogan means, phrase by phrase

"Requirements"
What it must do (the features) and how well it must do it (targets, in numbers). These are the test your design must pass.
"before"
Strictly first. Every later choice should point back to one of them: "I'm adding a cache because reads must be under 200 ms."
"rectangles"
The boxes of the first working version. Drawn only once you know what they're for, one requirement at a time.

Why this picture fits: the most common failure is drawing a familiar architecture immediately, then discovering it doesn't do what was asked. The slogan names that failure.

The story → the concept

Architect's stepDesign step
The brief from the familyFraming the problem and what it must do
Size, budget, building codesHow well it must do it, and the numbers
The list of roomsThe nouns
Doors between roomsThe contract
The floor planThe first working version
The structural engineer on the long spanMaking it hold up

Watch it on an example

Prompt: "Design a notification service."

  1. Rectangles first would give: API → queue → workers → push provider. Looks right.
  2. Requirements first asks: which channels? Must a password-reset email arrive within 30 seconds? Can a marketing push be dropped? What happens on a user's duplicate devices?
  3. The answers create two priority classes, per-user rate limits and idempotent sends: the actual design. The rectangles-first version had none of them.

The trap it saves you from

A confident, well-drawn solution to a problem nobody asked about.

It still works when…

You're changing an existing system. The "requirements" are then what must keep working, and what the change must add; the rectangles are the diff.

7. Common mistakes

Not finishing a working designThe most common reason for failing a design interview. Time-box each step, and get every feature working in a first version before you make it hold up.
Unmeasurable targets"Low latency" can't be designed against. "p99 under 200 ms for reads" can.
Premature complexityKafka, sharding and microservices on minute five, for a system with 100 writes a second. Add each part when a requirement needs it.
Components without reasonsEvery box should answer "which requirement does this serve?". Say the reason when you draw it.
Talking without checking inPause after the targets and after the first working version: "Does this match what you had in mind?" It catches misunderstandings early and gives the interviewer room to steer.

8. Design exercise (45 minutes, timed)

  1. Requirements drill (10 min). For each prompt, write the 3 things it must do and 3 measured targets: "design a photo-sharing app", "design a rate limiter", "design a leaderboard for an online game".
  2. API drill (5 min). Write the REST endpoints for the photo app's three features.
  3. Full design (25 min). Without looking at section 2, design Pastebin on paper with a timer, following all eight steps.
  4. Compare (5 min). Step through the Pastebin player again. What did you miss? Write it on the "Missed" line of your design notebook.

9. Self-check quiz

What comes first in a design?

Requirements define what you're building. Everything else is chosen to meet them.

Which is a useful quality target?

It's measurable and tells you what to optimise. "Use Redis" is a solution, not a requirement.

In POST /pastes, where should the server get the user's identity?

Anything in the request can be forged by the client. Identity comes from a verified token or session.

You're 20 minutes in with one requirement fully optimised and two not started. What should you have done?

Breadth before depth: a complete simple design is the baseline every level must reach.

The interviewer asks "why not use Cassandra here?" about your PostgreSQL choice. What's the best response?

Probing tests understanding. Name the trade-off (writes per second, consistency, query patterns) and stay open to a better argument.

Which is a useful non-functional requirement?

A quality with a number that changes the design. The third is a solution, not a requirement.

What does a senior candidate do that a mid-level one may not?

Seniority shows in ownership of the hard parts and trade-offs, not in the number of components.

10. Go deeper

ResourceTimeWhy
Delivery framework (Hello Interview)20 minA detailed version of these steps with timings, written by former interviewers.
How to approach a system design interview question (System Design Primer)10 minThe classic four-step outline, with links into each topic.
Design Docs at Google (Malte Ubl)15 minHow the same thinking becomes a design document at work, and when a doc is worth writing.
Architecture Decision Records10 minTemplates for recording a decision and its reasons in a few paragraphs.