How to answer any design question
What breaks
Section titled “What breaks”The interviewer reads you the prompt:
Design a service that sends an SMS reminder to a customer before each appointment.
You hear “reminders” and start drawing: a scheduler box, a queue, a worker pool, a cache and three databases. It looks like a real system, and for ten minutes it feels like progress.
Then the interviewer asks: how many reminders a day? You do not know, so you cannot say whether the queue is needed or whether one cron job on one server would do. Next: what happens if the SMS provider is down for an hour? There are fifteen minutes left, and the design has no place to put the answer. Then: what does the API look like? Nobody wrote one down.
So what was missing? Not knowledge. You know what queues and caches are. What broke was order: you designed before you knew what you were designing, so every later question landed on a design built for a problem nobody defined.
The companies that run these interviews say what they are listening for. Meta’s interview guide says the design interview is 45 minutes and that “it will be up to you to drive the conversation”. The first area it scores is problem navigation: “asking questions to reduce ambiguity … and define a requirement set to design to”. Amazon’s guide asks candidates to understand “the system’s scope and functional and non-functional requirements” before building a solution. Both guides want the problem defined before it is solved.
The fix is a fixed order of seven steps, each one feeding the next.
| Step | Question it answers | What it produces |
|---|---|---|
| 1. Requirements | What must it do, and how well? | A short list of features, and targets with numbers |
| 2. Estimates | How big is it? | Requests per second, storage, bandwidth |
| 3. API | How does the outside world use it? | The few calls clients make, with inputs and outputs |
| 4. Data | What is stored, and how is it read? | Entities, their key fields, the main read and write paths |
| 5. High-level design | What are the parts? | Five to seven boxes and the arrows between them |
| 6. Deep dive | Where is it hard? | One or two parts designed in detail, with the trade-off named |
| 7. Failure modes | How does it break? | What fails, what the user sees, and what limits the damage |
Terms used in this lesson:
- A functional requirement is something the system does: “send a reminder 24 hours before the appointment”.
- A non-functional requirement is how well it must do it: how fast, how available, how correct. “99.9% of reminders sent within five minutes of their scheduled time” is one.
- A back-of-envelope estimate is a rough calculation, done in a minute, that tells you the order of size: tens of requests a second, or tens of thousands.
- Requests per second (QPS, queries per second) is the rate at which work arrives.
- A deep dive is the part of the interview where you design one piece in detail.
- A failure mode is one specific way the system can break, such as “the SMS provider times out”.
Mental model
Section titled “Mental model”Narrow it, size it, shape it, stress it. Requirements narrow the problem. Estimates size it. API, data and high-level design shape it. The deep dive and failure modes stress it. Each step’s output is the next step’s input, and the arrow points backwards too: when a later step shows that an assumption was wrong, you go back, say so, and fix the earlier step.
Diagram
Section titled “Diagram”Three slides, one per part of the mental model. Swipe or scroll sideways.
Walking the reminder prompt through the steps
Section titled “Walking the reminder prompt through the steps”Here is the same prompt from “What breaks”, answered in order.
1. Requirements. Ask questions, then state the answers back as a list.
- Functional: send one SMS per appointment, 24 hours before it starts. Cancel the reminder if the appointment is cancelled. Move it if the appointment moves.
- Out of scope, said aloud: email, two-way replies, choosing the reminder time.
- Non-functional: a reminder may be a few minutes late but must never be sent twice or to a cancelled appointment. The service should be available 99.9% of the time. Google’s SRE book puts 99.9% at 8.76 hours of downtime a year.
2. Estimates. State each assumption, then do the arithmetic aloud. Assume 1,000,000 appointments booked a day, so 1,000,000 reminders a day. A day has 86,400 seconds: 1,000,000 ÷ 86,400 ≈ 12 reminders a second on average. Reminders bunch up, so assume a peak of ten times the average: about 120 a second. For storage, assume 500 bytes per stored reminder: 1,000,000 × 500 bytes = 500 MB a day, about 180 GB a year.
So is the queue from the opening needed? Not for volume. Twelve writes a second on average fits comfortably on one relational database. The interesting problem is sending each reminder exactly on time and exactly once while appointments keep changing.
3. API. Three calls cover the requirements:
scheduleReminder(appointmentId, phone, sendAt), cancelReminder(appointmentId) and
rescheduleReminder(appointmentId, newSendAt). Keying every call on appointmentId means a call
sent twice changes nothing the second time.
4. Data. One reminder entity: appointment id (unique), phone, send-at time, status
(scheduled, sent, cancelled, failed). The main read is “every scheduled reminder whose
send-at time has passed”, so send-at time and status need an index.
5. High-level design. An API service writes reminders to the database. A scheduler finds due reminders every few seconds and hands them to a sender. The sender calls the SMS provider and records the result. Amazon’s guide suggests “five to seven high-level blocks”; this problem is small enough for four, and saying so is better than adding boxes to reach a number.
6. Deep dive. Pick the hard part the estimates revealed: never send twice. If two scheduler
copies run, both can pick the same reminder. Options are a lock on the row while it is claimed, or
a status change from scheduled to sending that only one copy can win. Name the cost of the one
you choose. Later lessons (2.6 on idempotency, 2.7 on concurrency control) teach these properly;
in an interview, naming the race and one fix with its cost is the point.
7. Failure modes. The SMS provider is down: retry with growing waits, and stop retrying once the appointment has started, because a late reminder is useless. The database is down: nothing is lost, reminders are sent late, and the five-minute target is missed. Load triples: the SRE book notes that “the most common cause of cascading failures is overload”, so the sender should send at a fixed rate and let reminders queue in the database rather than push every one at the provider at once.
A time budget for 45 minutes
Section titled “A time budget for 45 minutes”Meta’s guide gives 45 minutes in total, with a few minutes kept for your questions, and suggests practising “in roughly 30 minutes per question”. Amazon’s interviews are 55 minutes. Neither publishes a split by step, so the split below is this course’s suggestion, not a company rule.
| Step | Minutes |
|---|---|
| Requirements | 5 |
| Estimates | 3 |
| API | 4 |
| Data | 4 |
| High-level design | 8 |
| Deep dive | 10 |
| Failure modes | 5 |
| Your questions | 5 |
If the interviewer pulls you into a deep dive early, follow them, then say which steps you skipped and offer to return. Driving the conversation does not mean ignoring the person scoring it: Meta scores technical communication partly on your ability to “understand and address feedback from the interviewer”.
Trade-offs
Section titled “Trade-offs”Breadth against depth. A full pass through all seven steps shows you can see the whole system. A long deep dive shows you can go deep. Amazon’s guide says it wants “broad comprehension of system design and expertise in one area”. Spend too long on breadth and you never show depth; dive too early and you design a perfect part of the wrong system. In the reminder answer, breadth was the four boxes and depth was never send twice. The time budget is how you pay for both.
Asking questions against using the time. How long should you ask? Every requirement question costs time and makes the design fit the problem. This course’s rule of thumb is about five minutes; past that, you are spending the time the design needs. When the interviewer says “you decide”, make the assumption out loud and move on. You can revise it later.
Precise estimates against quick ones. An estimate exists to make a decision: one database or many, cache or no cache. In the reminder answer it settled one thing, that volume is not the problem, and a rougher number would have said the same. Round hard (86,400 seconds is “about 100,000”) once the order of size is clear. Precision that does not change a decision is wasted time. Hardware numbers also date. Jeff Dean’s well-known 2009 table puts a round trip within one data centre at 500,000 ns (0.5 ms) and a disk seek at 10,000,000 ns (10 ms), and those are 2009 numbers for spinning disks. Lesson 0.3 covers estimation in depth.
Following the script against following the interviewer. The seven steps keep you from getting lost; they are not a contract. Interviews come in different shapes: Meta’s guide separates a systems design interview (distributed systems, scale) from a product architectural design interview (APIs, usability). In the second kind, the API step deserves more of the clock. And when the interviewer asks about one step, as in the second drill, reciting all seven is not addressing their feedback.
One answer against several. Meta’s guide asks you to avoid “focusing on only optimal solutions” and says “we’re much more interested in seeing how you think through basic tradeoffs”. Amazon’s says: “compare their trade-offs, select one, and justify your decision.” So offer two options and choose one with a reason. In the reminder deep dive, that was the row lock against the status change.
Drill 1 — interview question
Section titled “Drill 1 — interview question”“Design a service that lets a business send a one-off SMS announcement to all of its customers.” Do only steps 1 and 2 aloud, in eight minutes. State your requirements and your estimates, and say which one design decision your estimates settle.
Model answer
Requirements. Functional: a business writes one message and sends it to every customer who has agreed to receive messages; it sees how many were delivered. Out of scope: scheduling, replies, templates. Non-functional: each customer gets the message at most once; all messages go out within an hour; a customer who has opted out must never get one; the send button may fail, but a failure must be reported, not silent.
Estimates. Assume 10,000 businesses with 2,000 customers each, and each business sends one announcement a week. That is 20,000,000 messages a week. Spread over a week it is about 33 a second (20,000,000 ÷ 604,800). But one business sends all 2,000 at once, and several can press send in the same minute, so peak matters more than average: 100 businesses in one minute is 200,000 messages, about 3,300 a second.
Decision the estimates settle. The average is small, the peak is large and short. So the design must take the whole send as one fast request and work through the messages at the rate the SMS provider allows, rather than sending them during the request. The estimate also shows that the provider’s rate limit, not the database, is likely the real ceiling — a question to ask the interviewer.
Rubric
- Separates functional from non-functional requirements and names something out of scope — 2
- Non-functional requirements carry numbers or testable words (“at most once”, “within an hour”) — 2
- States assumptions before calculating, and the arithmetic is right to the order of size — 2
- Estimates peak, not only average, and says why peak matters here — 2
- Names one design decision the numbers settle — 2
Total 10. 8 or more is a pass.
Drill 2 — interview question
Section titled “Drill 2 — interview question”You are twelve minutes into a reminder-service answer and have just finished the API. The interviewer says: “Let’s skip ahead. How do you make sure a reminder is never sent twice?” What do you do, and what do you say?
Model answer
Follow the interviewer: they have told you where the score is. Say one sentence that keeps the
structure visible — “I’ll jump to that; I haven’t sketched the data model or the boxes yet, so let
me give the minimum of each first.” Then give the reminder table in one line (appointment id,
send-at time, status) and the four boxes (API, database, scheduler, sender) in one more, because the answer
to “never twice” depends on them. Then the deep dive: two scheduler copies can claim the same row;
make the claim a single status change from scheduled to sending that only one copy can win, and
name its cost (a reminder stuck in sending after a crash needs a timeout to be retried). At the
end, offer to come back to failure modes.
Rubric
- Follows the redirect instead of finishing the planned steps — 2
- Says which steps are skipped, and gives the minimum context the answer depends on — 2
- Names the race (two copies picking the same reminder) — 2
- Offers one fix and states its cost — 2
- Offers to return to the skipped steps — 2
Total 10. 8 or more is a pass.
Drill 3 — hands-on exercise
Section titled “Drill 3 — hands-on exercise”- Set a timer for 40 minutes. Prompt: “Design a service that stores text snippets and gives each one a link anyone can open.”
- On one page, write a heading for each of the seven steps, and under each, only what that step produces (see the table in “What breaks”).
- Each time you move to the next step, write the time on the clock next to its heading.
- When the timer ends, compare your times with the budget in this lesson. Note the step that ran longest and the step you skipped or rushed.
- Score yourself on the rubric used in Part 5: requirements, estimation, API, data model, high-level design, deep dive, failure modes, trade-offs, communication — 0 to 2 each.
- Keep the page. Redo the same prompt in seven days without looking at it, and compare.
Exit test
Section titled “Exit test”Answer without notes.
- Name the seven steps in order, and say what each one produces.
- For “design a service that counts views on a video”, give two functional and two non-functional requirements, each non-functional one with a number.
- A service gets 5,000,000 requests a day, and peak is five times the average. Roughly how many requests a second is the peak? Show the arithmetic.
- A candidate skips estimates and goes straight to high-level design. Give one concrete way this can go wrong.
- Twenty minutes in, the interviewer asks you to go deep on a part you have not reached. What do you say, and why?
Further reading
Section titled “Further reading”- Meta, Full Loop Interview Guide for software engineers, the design interview section — download from https://www.metacareers.com/swe-prep-onsite/. The four focus areas this lesson quotes.
- Amazon, SDE III interview prep, systems design section — https://amazon.jobs/content/en/how-we-hire/sde-iii-interview-prep. Requirements, high-level blocks, data model or API, and growth questions.
- Google, Site Reliability Engineering, “Embracing Risk” — https://sre.google/sre-book/embracing-risk/, and the availability table — https://sre.google/sre-book/availability-table/. How availability targets become numbers.
- Google, Site Reliability Engineering, “Service Level Objectives” — https://sre.google/sre-book/service-level-objectives/. How to write a non-functional requirement as a measurable target.
- Google, Site Reliability Engineering, “Addressing Cascading Failures” — https://sre.google/sre-book/addressing-cascading-failures/, and “Handling Overload” — https://sre.google/sre-book/handling-overload/. Thinking about failure modes.
- Jeff Dean, Designs, Lessons and Advice from Building Large Distributed Systems, LADIS 2009, slide 24 “Numbers Everyone Should Know” — https://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf. Dated 2009.