SteelReed

Search

Search posts, questions…

7. System Design

The system design interview: a four-step process and clarifying requirements

What system design is and how it differs from architecture, what interviewers grade, four steps in 45 minutes, picking at most three functional requirements, turning non-functional requirements into numbers, and proving a design is good before writing code. With solutions for Tinder, DoorDash and Binance.

18 Nov 20269 min readMid

–

1. The problem

The prompt: "design Airbnb". The candidate immediately draws Kafka, Redis and sharding by user_id. At minute 30 the interviewer asks "is this read-heavy or write-heavy?" and the candidate doesn't know.

2. Key idea

Like a doctor's visit: symptoms first, prescription later. Interviewers score problem solving, fundamentals (answering "why" with data structures, I/O, networking), communication, and a bonus for product thinking; the final design is just the evidence.

Step What to do Time
1. Understand the problem FRs (at most 3), NFRs with numbers, assumptions, out of scope 5–8 min
2. Estimate read/write QPS, storage, bandwidth 3–5 min
3. High-level design API, data model, block diagram 10–15 min
4. Deep dive 1–2 hard parts: storage, concurrency, hot keys, failures 15–20 min
Wrap up remaining bottlenecks, how to extend 2–3 min

Separate assumptions from facts and say them out loud.

2.1 Functional requirements: pick at most three

In 45 minutes you can solve three FRs. Two filtering questions: which feature directly solves the customer's problem (Airbnb: search stays by location), and which makes money (booking). Write each with actor, activity, work object: "a patient books an appointment with a doctor": a complete sentence reveals entities for the data model and endpoints for the API.

2.2 Non-functional requirements: adjectives into numbers

"Fast" and "stable" aren't requirements; "p99 < 200 ms at 10K QPS" is. The key NFRs are what breaks the experience or blocks growth.

System Top NFRs Not prioritised when
Money, exchanges reliability, security availability when data might be wrong: stop rather than be wrong
Social feeds availability, latency instant consistency
Early-stage startup feature speed, cost distant scalability

Availability asks "is it answering?"; reliability asks "is it doing the right thing?".

3. Worked example: NFRs for a homestay booking system

50 million users, 5 million DAU, 10 searches per user per day
  → 50 million searches/day ≈ 600 QPS average, peak ×5 ≈ 3K QPS
Bookings 200K/day ≈ 2–3 TPS, but a night must NEVER be sold twice
Search: p99 < 300 ms; prices a few seconds stale are fine (eventual consistency)
Availability: search 99.95%, booking 99.9% (better to error than to book wrong)
Keep booking history 7 years (accounting); images in object storage

One system has two sets of NFRs: the read path is fast and tolerates staleness, the write path is slower but correct.

Evaluating a design before writing code
  • Necessary: it meets the FRs, NFRs and constraints (timeline, cost, team skills).
  • Sufficient: mechanism-level evidence for each choice, found by asking "why" all the way down. "Find values X from 34 to 88": a B+Tree keeps leaves ordered, finds the start in O(log N) and scans M elements, so choosing a B-Tree index is justified.
  • Not evidence: "Netflix uses Cassandra so we will". Evidence is: "write-heavy, key-based access, eventual consistency is fine, so an LSM tree's sequential writes fit better than a B-Tree".
  • Scalability: at 10x load, what breaks first.
  • Commonly forgotten FR questions: which query runs most (it drives indexes, caching, partitioning); in-house or SaaS (tenant isolation); is realtime needed; what if two people book the same room; can notifications be lost or duplicated.

4. Working with AI

Delegate to AI: playing an interviewer who pushes back, checking your estimates, listing clarifying questions for a prompt.

Check a design (yours or AI-drafted):

  • At most three FRs, each with actor, activity and object.
  • Every NFR has a number; read and write paths have their own NFRs.
  • Every component (cache, broker, shard) is justified by an FR/NFR, not "company X uses it".
  • At least one deep dive into the hardest part (concurrency, hot keys, failures).

5. Exercises

Exercise 1: FRs for a dating app

List the FRs of a Tinder-style dating app, then pick three worth solving in 45 minutes. What deserves a deep dive?

Solution to Exercise 1
  • Full FRs: profiles (photos, age, interests); a profile feed by location and filters; swipe like or pass, mutual likes become a match; messaging after a match; paid plans.
  • Pick three: location-based feed (solves "find people near me"), swipe and match (the product's core), paid plans (revenue). Leave chat out of scope: it's a whole design problem of its own.
  • Deep dive: the feed needs a spatial index (geohash, quadtree, PostGIS) and must exclude already-swiped profiles (a big set per user, maybe a Bloom filter); matching must catch two likes arriving almost simultaneously.

Exercise 2: NFRs for an exchange versus food delivery

Find NFRs with numbers for (a) a DoorDash-style food delivery service and (b) a Binance-style exchange. Why do their priorities differ?

Solution to Exercise 2
  • (a) Food delivery: load piles into meal times, 5–10x off-peak; 10 million orders/day, peak ~1,000 orders/second. Driver locations every 4 seconds from 500K online drivers is ~125K writes/second: the heaviest part. Ordering 99.95%; restaurant search p99 < 300 ms; an order is never assigned to two drivers.
  • (b) Exchange: matching must be exactly right, nothing lost or duplicated (one sequential matcher per pair, an event log); security first; order-book updates p99 < 100 ms; 99.99% availability, but if data looks wrong, stop matching.
  • The difference: in (b) correctness beats availability. Food delivery can reassign a driver; an exchange can't match wrongly and fix it later.

Summary

  • Four steps: scope, estimate, high-level design, deep dive.
  • At most three FRs: the one that solves customer pain and the one that makes money.
  • NFRs need numbers; read and write paths often have different NFRs.
  • Availability isn't reliability; NFR order depends on the kind of system.
  • Understand the problem before picking technology; evidence is mechanism, not brand names.

Further reading: Scalability, performance and availability principles.

Practice interview questions on this topic

All System Design questions →

Loading comments…
Next on the roadmapBack-of-the-envelope estimation: numbers to know and how to calculate fast