Free preview

Putting Numbers on NFRs

Why this matters: Lesson 1 claimed an NFR without a number isn't a requirement. This lesson is how you produce the number — including when the interviewer deliberately refuses to give you one.

Key takeaway

Nobody hands you non-functional requirements. You extract them with clarifying questions, derive them with arithmetic, and defend them by naming the decision each one forces. Precision is not the goal — the right order of magnitude, stated out loud, is.

Step 1: Ask

Proactively clarify NFRs early. The three questions that unlock most designs:

  • Expected user traffic — how many users, how active, how spiky?
  • Expected data load — how much stored, growing how fast, kept how long?
  • Expected downtime tolerance — what does an outage actually cost?

Follow-ups worth asking when they matter:

QuestionWhy it mattersWhat the answer changes
Read/write ratio?Decides where to spend complexityRead-heavy → caching and replicas; write-heavy → sharding and queues
How spiky is traffic?Peak, not average, sizes the systemFlat → autoscaling suffices; spiky → queues and pre-warmed capacity
Latency budget, for which operation?Budgets differ wildly per pathTight → colocate and cache; loose → allow async
Cost of a stale read here?The consistency question from Chapter 1Low → eventual; high → strong, and pay for it
Global or single-region?Geography sets a latency floorGlobal → regional replicas, residency rules
Retention period?Storage grows without bound otherwiseSets total storage and tiering strategy

Step 2: Derive

Four pieces of arithmetic carry most interviews. Round aggressively — you want the exponent, not the digits.

Requests per second

Average QPS = DAU * actions per user per day / 86,400
Peak QPS    = Average QPS * peak factor      (typically 2x to 10x)

Use 100,000 seconds per day instead of 86,400. The 15% error is irrelevant and the mental arithmetic becomes trivial.

Storage

Storage per day   = writes per day * bytes per write
Total storage     = storage per day * retention days * replication factor

Forgetting the replication factor is the most common miss — three replicas means three times the storage bill, and cross-region makes it more.

Bandwidth

Egress = QPS * average response size

Memory for a cache

Cache size = hot data fraction * total data

The usual heuristic: 20% of the data serves 80% of requests, so caching the hot fifth captures most reads.

A worked example

"Design a photo-sharing service." No numbers given.

Assume and state:

DAU                    = 100 million
Photos uploaded/user/day = 0.2      (1 photo every 5 days)
Photo views/user/day     = 50
Average photo size       = 2 MB
Retention                = forever
Replication factor       = 3

Derive:

Uploads/day  = 100M * 0.2       = 20 million
Write QPS    = 20M / 100,000    = 200 writes/sec
Peak writes  = 200 * 3          = 600 writes/sec

Views/day    = 100M * 50        = 5 billion
Read QPS     = 5B / 100,000     = 50,000 reads/sec
Peak reads   = 50,000 * 3       = 150,000 reads/sec

Read/write ratio = 50,000 / 200 = 250:1

Storage/day  = 20M * 2 MB       = 40 TB/day
With 3x replication             = 120 TB/day
Per year                        = ~44 PB/year

Egress at peak = 150,000 * 2 MB = 300 GB/sec

Now read the numbers as decisions — this is the part that scores:

NumberWhat it tells youDesign decision it forces
250:1 read/writeOverwhelmingly read-dominatedOptimize reads hard; writes can be expensive
600 peak writes/secGenuinely modestA single well-tuned primary can handle metadata writes
150,000 peak reads/secLargeAggressive caching plus read replicas — do not serve from the primary
300 GB/sec egressThe dominant cost and constraintCDN is mandatory, not an optimization — origin must never serve photo bytes
44 PB/year, growingUnbounded storageObject storage, not a database; tier cold photos to cheaper classes
2 MB average objectBlobs, not rowsSplit metadata (database) from bytes (object store)

Step 3: Translate to requirements

Convert the arithmetic into a stated NFR table — this is what you write on the board:

NFRTargetJustification
Availability99.9% (43 min/month)Photo viewing is not safety-critical; four nines isn't worth the cost
Read latencyp99 under 200 msFeed must feel instant; CDN puts bytes near users
Write latencyp99 under 2 s for upload ackUsers accept an upload spinner; processing is async
DurabilityNo photo ever lostIrreplaceable user data — stronger requirement than availability
Scalability10x growth without redesignStateless tier, sharded metadata, object storage scales independently
ConsistencyEventual for feeds, strong for privacy settingsStale like count is harmless; stale privacy setting leaks a photo

Notice durability being ranked above availability. That is a deliberate, defensible choice for this product: a brief outage annoys users; a lost photo is unforgivable. Stating that ranking is exactly the Staff-level move from Lesson 1.

Common patterns worth having ready

Certain requirements map to well-known answers. Recognizing them fast leaves time for the interesting parts:

RequirementTypical answerBecause
Transactions, strong invariantsACID-compliant relational databaseConstraints and multi-row atomicity are what it's for
Large-scale data, high write volumeNoSQL (MongoDB, Cassandra)Horizontal scale and flexible schema over join capability
Real-time streams and event fan-outKafka or KinesisDurable ordered log, replayable, many independent consumers
Large static content, global audienceObject storage + CDNEgress and latency both solved at the edge
Spiky, slow, or retriable workQueue plus workersAbsorbs bursts; decouples the interactive path

Key takeaway

Estimation is not about precision. It is about reaching the right order of magnitude fast enough that the number can drive a decision — and then saying out loud which decision it drove.

Interview signal by level

LevelWhat a strong answer sounds like
L4Waits for numbers, or gives requirements without any.
L5Estimates correctly: "100M DAU at 50 views each is 5 billion reads a day, about 50k QPS average."
Staff+Uses the estimate to decide: "300 GB/sec of egress makes the CDN non-negotiable and means origin never serves bytes. If my DAU assumption is 10x off, that conclusion still holds — which is why I'm comfortable committing to it now."

Next: all of it applied to one interview, start to finish.

Enjoying the preview?

Create a free account to unlock the rest of this course, the in-browser judge, and live AI mock interviews.

Sign up free to continue