System Design

Interview Craft

The First Five Minutes: Requirements

Most candidates spend the first five minutes listing every feature and writing highly available, scalable, low latency. Those five minutes decide which system you design, and a requirement only belongs on the board if a different answer would change it.

Most candidates treat the first five minutes of a system design interview as a form to fill in. They list every feature the product has, then write "highly available, scalable, low latency". They ask how many users there are and never use the number again. Then they draw the design they had in mind before anyone asked.

Those five minutes decide which system you design. "Design WhatsApp" can mean a relay that forgets each message once the phone has it, or an archive of every message ever sent. The WhatsApp breakdown sizes the first at about 4 TB and the second at 18 PB a year, and one question in the first two minutes picks between them.

The prompt is vague on purpose. Amazon's prep page for senior engineers calls it "an ambiguous problem to be solved in one line". The first of the four areas in Meta's guide is problem navigation, and it ends with defining "a requirement set to design to".

How a System Design Interview Is Scored covers how those areas are graded. This page is the method behind the Understanding the problem section that opens every breakdown in this course.

A requirement is worth writing down only if a different answer would give you a different design.

Split the name, then ask one question

The five minutes have five steps, in this order.

  1. Split the name.
  2. Ask the question that forks the design.
  3. Write what the system does, and what it does not.
  4. Put numbers on it.
  5. Name the requirement the design rests on.
The news feed's first five minutes
The bar along the top is the five minutes, split by step, and below it is what the news feed breakdown writes at each step. The split keeps the home feed, leaves the ranked feed for the question, and drops explore and notifications (1). One question settles the order (2). The four things a user can do come next, with the out-of-scope list below them in grey (3). The numbers follow, where p99 is the time that 99 of every 100 requests finish within (4). The last step, in green, names the requirement the design rests on (5).The bar along the top is the five minutes, split by step, and below it is what the news feed breakdown writes at each step. The split keeps the home feed, leaves the ranked feed for the question, and drops explore and notifications (1). One question settles the order (2). The four things a user can do come next, with the out-of-scope list below them in grey (3). The numbers follow, where p99 is the time that 99 of every 100 requests finish within (4). The last step, in green, names the requirement the design rests on (5).
Each step narrows the next one. The bar along the top is the five minutes, split by step, and below it is what the news feed breakdown writes at each step. The split keeps the home feed, leaves the ranked feed for the question, and drops explore and notifications (1). One question settles the order (2). The four things a user can do come next, with the out-of-scope list below them in grey (3). The numbers follow, where p99 is the time that 99 of every 100 requests finish within (4). The last step, in green, names the requirement the design rests on (5).

The split

The name in a prompt nearly always covers several systems. The Instagram breakdown counts six under "Instagram": photo posts with the following feed, Stories, Reels, direct messages, Explore and live video. Their designs have almost nothing in common: direct messages are a chat system, and Reels need a video pipeline.

So say which one you are building, and why, in one line. The Instagram breakdown says: "I am building durable photo posts and the following feed, because that is where the media pipeline and the feed interact."

Every system you drop takes a subsystem out of the next forty minutes. "Rate limiting" covers four problems. Abuse, accidental overload and fairness between customers need a rough count, answered in milliseconds. Plan quotas need an exact count checked against invoices. If you leave quotas in, you build a billing system inside the rate limiter.

The question that forks the design

A question is worth asking when its two plausible answers lead to two different designs. Before you ask, say both answers to yourself, and the design each one leads to. If the designs are the same, do not ask. Say what you will assume and move on.

QuestionOne answerThe other answer
Which of the four problems matters? (rate limiter)The service: a rough count in millisecondsPlan quotas: an exact count, which is billing
Is server-side history in scope? (WhatsApp)No: a spool of about 4 TBYes: an archive growing 18 PB a year, which is Slack
Is the feed chronological or ranked? (news feed)Chronological: feeds filled in advanceRanked: the order depends on the reader, so feeds cannot be filled the same way
Can a live link's destination change? (URL shortener)No: copies cached foreverYes: every cached copy has to hear about it
A question that does not fork
Whether the limit is 1,000 or 5,000 a minute, the answer is one value in the same yellow rule. The gateway and Redis stay as they are, and so does the number of keys. The question changes the config, not the design, so state an assumption instead of asking it.Whether the limit is 1,000 or 5,000 a minute, the answer is one value in the same yellow rule. The gateway and Redis stay as they are, and so does the number of keys. The question changes the config, not the design, so state an assumption instead of asking it.
Both answers land on the same rule. Whether the limit is 1,000 or 5,000 a minute, the answer is one value in the same yellow rule. The gateway and Redis stay as they are, and so does the number of keys. The question changes the config, not the design, so state an assumption instead of asking it.

Three more kinds of question fail the test.

Asking about features. "Can users edit a post?" Editing adds a column and an update path, and both answers leave the same boxes on the board.

Asking about technology. "Can I use Kafka?" At minute three the board has no write rate and no latency budget, so nothing on it can make Kafka right or wrong yet.

Handing over the choice. "Should it be consistent or available?", with no default of your own. Propose an assumption instead, as Amazon's page asks. For example: "I will assume a post may take a few seconds to reach followers' feeds, so I can fill them from a queue. Does that work?"

Write what it does, and what it does not

A functional requirement is something the system does for a user or an operator, such as sending a message or opening a feed. Write three to five. The high-level design gets about fifteen minutes, so four requirements get about four minutes each. Ten get ninety seconds each, too little to defend one choice.

Apply the test to each line. "Users can log in" changes nothing in the design, so the rate limiter, URL shortener and Instagram breakdowns all leave authentication out. A line passes when it needs a part of the design of its own. In WhatsApp, "deliver to a user who was offline" needs a spool, a small per-device queue that holds messages until the phone reconnects.

Then say what you are not building, while an objection is still cheap. Five of the six breakdowns head that list "Out of scope, deliberately". Each item is one of three kinds, and each kind takes its own reason.

A different layer. Examples are authentication and absorbing a distributed denial-of-service (DDoS) flood. One clause is enough, such as "someone upstream has already worked out who the caller is".

A different system that shares the name. Examples are message history, Explore and live streaming. Say what it would add. In WhatsApp, search over history is "a different product with an 18 PB data store attached".

A feature that breaks the design's main assumption. The URL shortener leaves out editing a live link's destination, because its design rests on a mapping that never changes once written. Naming this kind shows that you know what your design depends on.

Put numbers on it

A non-functional requirement says how well the system does its job. "Highly available, scalable, low latency" fails the test, because every system wants all three. As Amazon's page puts it, a customer "may assume the system will be fast and secure". Turn each word into a number a design can be checked against.

  • Scale, in the unit the design runs out of.
  • Latency, with a percentile. The rate limiter writes "under 5 ms at p99", because it runs on every request and an average would hide its slow checks.
  • Availability, per path. In the URL shortener, creation can be down for minutes, but redirects cannot, because the links are already printed on posters.
  • What may be late, approximate or lost. "Click counts may be approximate and late. The mapping may not."

Pick the unit that runs out

Meta's guide shows its tip to start with the requirements on the front end of a messaging system. The first sample question there is "How many users are we talking about?" For the backend, the answer needs one more step, because a chat server runs out of open connections, not users.

Back of envelopeTwo counts for a chat system, and which one sizes it
The WhatsApp breakdown starts from 50 billion messages a day
and 100 million phones connected at peak. The first line is
the one division worth doing in the first five minutes. The
rest shows why the message count does not size anything.
WhatsApp reported running 1 million connections per server.

Connections
  100M live / 1M per server                = 100 chat servers

Messages, spread over those 100 servers
  50B a day / 86,400 s                     ≈ 580,000/s average
  peak at 3x average, assumed              ≈ 1.7M/s
  1.7M/s / 100 servers                     ≈ 17,000 sends/s each
──────────────────────────────────────────────────────────────
The connections set the number of servers. At 17,000 sends a
second each, the messages are an ordinary load for them.

So the WhatsApp breakdown writes "100 million live sockets at peak" as its first non-functional requirement. A rate limiter runs out of operations a second on its counters instead, and Instagram runs out of bytes.

A latency number can rule out an option on its own. Delivery under 500 ms at p99 means a polling phone has to ask every half second. For 100 million phones, that is 200 million requests a second, 98 percent of them empty, so polling is out before anyone draws a box.

Say which numbers are yours. The Instagram breakdown marks its 500 million daily users as its own working figure, not a published one. If the interviewer gives you a number, use theirs. Otherwise pick a round one, and say what twice or ten times the value would change, the check Amazon's page suggests.

Name the requirement the design rests on

One non-functional requirement carries the design. Every breakdown names it, and three tell you to write it down in exact words. It takes one of two forms.

A permission. It says what the system may get wrong, deliver late or forget.

A ratio. It says which side of the system gets the effort.

BreakdownThe requirementFormWhat it allows
Rate limiterApproximately correct is correctpermissionNo persistence or synchronous replication, and a rough local limit when Redis cannot answer
News feedA post may take seconds to appearpermissionFeeds filled from a queue
WhatsAppNothing is lost once acceptedpermission, as the narrowest promiseMessages kept only until delivered
URL shortenerCodes are permanent; clicks may be late, the mapping may notpermission, plus a promiseMappings cached forever, and a click pipeline that may lose a few events
InstagramMedia outweighs metadata about 1,300 to 1 in bytesratioTwo planes that share only a URL
YouTubeAbout 1,400 watch-hours per uploaded hour, on averageratioHeavy compute spent to make files smaller

Four of the six are permissions. Each names something the product can live with: a count a little over the limit, a post a few seconds late, a message forgotten once delivered, a lost click. The design uses that allowance to remove work.

What seconds, not instantly, changes
In the top row, the post must be in every follower's feed before the request returns, so for an account with 1 million followers the request waits on 1 million writes, in red. In the bottom row, the service stores the post and returns at once, in green (1). A queue (2) hands the post to fanout workers (3), and they fill the feeds over the next few seconds (4).In the top row, the post must be in every follower's feed before the request returns, so for an account with 1 million followers the request waits on 1 million writes, in red. In the bottom row, the service stores the post and returns at once, in green (1). A queue (2) hands the post to fanout workers (3), and they fill the feeds over the next few seconds (4).
The permission moves the fanout off the request. In the top row, the post must be in every follower's feed before the request returns, so for an account with 1 million followers the request waits on 1 million writes, in red. In the bottom row, the service stores the post and returns at once, in green (1). A queue (2) hands the post to fanout workers (3), and they fill the feeds over the next few seconds (4).

Say it out loud, with what it lets you skip, so you can point back to it when a choice is challenged later.

The WhatsApp opening, three ways

Three candidates who know the same facts about chat can leave three different boards at minute five. What should the board hold, when everything on it has to fit into the fifteen minutes of design that follow?

Naive

Write down every feature, then the usual qualities

1:1 messages, groups, history and search, read receipts,
online status, typing, photos and video, voice calls
highly available, scalable, low latency, secure
2 billion users

It looks thorough, and every item is something the app does. But eight features in fifteen minutes of design is under two minutes each. History came in without anyone choosing it, and at 50 billion messages a day of about 1 KB, it is an archive growing by 18 PB a year. Nothing on the board rules out polling or sizes the fleet.

Senior

Split the name, ask one question, and put numbers on it

Building: real-time relay, offline delivery, groups
Asked: is server-side history in scope? No.
Does: send, deliver offline, groups of 1,024, receipts
Out of scope: history and search, calls, media, contacts
500M daily users, 50B messages a day
delivery under 500 ms at p99, same region
messages are durable

A design built from this board will work, but two lines are weak. The scale is in users and messages, and neither is what runs out. And "durable" does not say how long a delivered message is kept, so the size of the spool is still open.

Staff

Word the requirements so they remove work

100M live sockets at peak           <- sizes the fleet
delivery under 500 ms at p99, same region
nothing is lost once accepted       <- the design rests on this

This tier drops an assumption the other two share: that requirements are facts you collect from the interviewer. Two of these lines are choices of wording, and each wording gives a different design.

"Nothing is lost once accepted" promises only that the server will not drop a message it has acknowledged. So it can delete each message once the phone confirms it. The WhatsApp breakdown sizes that spool at about 4.2 TB, against 18 PB for a year of delivered messages. The cost is that history lives on the phone, and has to move with the user to a new device.

One requirement, two wordings
The axis is linear. The red bar is every message kept for a year after delivery, 18 PB, which durable alone does not rule out. The green sliver is each message kept only until it is delivered, about 4.2 TB. It is drawn wider than it should be, because to scale it would be under a pixel.The axis is linear. The red bar is every message kept for a year after delivery, 18 PB, which durable alone does not rule out. The green sliver is each message kept only until it is delivered, about 4.2 TB. It is drawn wider than it should be, because to scale it would be under a pixel.
The narrow promise needs about 4,000 times less storage. The axis is linear. The red bar is every message kept for a year after delivery, 18 PB, which durable alone does not rule out. The green sliver is each message kept only until it is delivered, about 4.2 TB. It is drawn wider than it should be, because to scale it would be under a pixel.

"100 million live sockets" is the count the servers run out of: about 100 servers at 1 million each.

Where it goes wrong

1. Promising more than the product needs

Three breakdowns warn against the same reflex: "strongly consistent" in the rate limiter, identical feeds for every user in the news feed, and exactly-once delivery in WhatsApp. The first two cost coordination on every request or write. The third cannot be kept, because a phone that drops mid-acknowledgement forces a resend. Before you write "consistent", "exactly once" or "real time", ask what a user would see without it.

2. Letting the five minutes run long

Every minute past five comes out of the high-level design. Instead of asking open questions one at a time, propose several at once: "I'll assume a chronological feed, a few seconds before a post appears, and no media storage. Stop me if any of those is wrong."

The mistakes that come after the first five minutes are in The Ten Most Common Ways Candidates Fail.

If you remember nothing else

A line goes on the board only if a different answer changes the designthe test for every question and number
Split the name firstbuild one system, and say why
Ask by proposing"I'll assume X, because it lets me do Y"
Size in the unit that runs outconnections for chat, bytes for photos
Name the requirement the design rests onusually a permission, worded narrowly
Say what is out of scope, with a reasonbest of all, what breaks your main assumption

What is expected at each level

What each level does differently on the same question is in What Separates Mid, Senior and Staff.

Mid-level

Produce a usable board with some help: the split when asked, three to five functional requirements, and numbers for scale and latency when prompted. You are expected to settle the scope before you draw. You are not expected to find the requirement the design rests on.

Senior

You drive the five minutes, and three things appear without prompting.

The split, with a reason. One line naming the system you are building.

Numbers with units and percentiles, so the design can be checked against them.

Out of scope, said out loud, with a reason for each item.

Staff+

A correct, well-scoped board is still the bar. A staff answer also uses the board to decide what not to build.

Name the requirement the design rests on, in the narrowest words that hold, and size what the wording removes.

Be able to say what you would not build. In this course, that means no 18 PB archive for a product that keeps messages only until delivery, and no billing-grade counter inside a rate limiter. It also means no edit path for live short links that every edge cache would then have to hear about.

Sources

What Meta and Amazon expect comes from their own candidate guides. The connections per server come from WhatsApp's published account, and every other figure from the course's breakdowns.

Spot a mistake, or something unclear? . Or get in touch.

Article

Send feedback

Thank you for helping. We read every report and fix what is wrong.

How do you feel about oneby7?

Sign in to oneby7

Keep your progress, your streak and your code, on any device.

New here? This creates your account too.