CMD Guide
HomeSystem DesignSystem Design Trade-offs

Functional vs Nonfunctional Requirements

Functional vs Nonfunctional Requirements

Every system-design interview opens the same way: "Design a URL shortener," or "Design Twitter's timeline." The prompt is deliberately vague. Before you draw a single box, you must split the problem into two kinds of requirements, because they are answered by completely different parts of your design.

Functional requirements (FRs) describe what the system does — the features, the verbs, the observable behavior a user or client can name. "Given a long URL, return a short code" or "resolve a short code back to the original URL and redirect." If a product manager can write it as a user story, it is functional.

Nonfunctional requirements (NFRs) describe how well the system must do those things — the qualities: latency, throughput, availability, durability, consistency, cost, security, scalability. Nobody asks for "99.99% availability" as a feature, yet it dictates almost every hard architectural choice you make. The concept exists to stop you from building something that technically works but falls over at 10,000 requests per second, loses data on a crash, or takes two seconds to load.

How it works, precisely

The mechanism is a mapping: FRs map to your API surface and data model; NFRs map to your infrastructure and topology. They are elicited and used differently.

Critically, NFRs are the ones with tension between them. You cannot maximize consistency, availability, and partition-tolerance at once (CAP); you trade low latency against strong consistency; you trade cost against redundancy. That tension is where senior-level judgment lives — and why interviewers weight NFRs so heavily. FRs tell you which boxes to draw; NFRs tell you how many of each box and how they connect.

A worked scenario: the URL shortener

Say the interviewer gives you 100 million new URLs per day with a 100:1 read-to-write ratio. Watch how each requirement type drives a different decision.

Functional side (unaffected by scale): shorten a URL, redirect on lookup, optionally support custom aliases and expiry. These endpoints look identical whether you serve 100 users or 100 million.

Nonfunctional side (where the numbers bite):

The FR "redirect a short code" is one sentence. The NFRs behind it just forced a cache tier, a sharded datastore, replication, and a load balancer into your diagram.

Trade-offs: when to lead with which

The two are not alternatives you choose between — every system has both — but you allocate design time between them, and getting the balance wrong is the failure mode.

The senior signal is stating NFRs as quantified SLOs with a rationale ("p99 < 200 ms because it's a user-facing feed; 99.9% because a brief outage is tolerable and the fourth nine approximately doubles the cost — the redundancy derivation below shows why") rather than reciting adjectives like "fast" and "scalable."

Pitfalls an interviewer probes

Operationalizing NFRs: SLI, SLO, SLA, and error budgets

In production, NFRs are not adjectives — they are measured contracts:

Translation example (URL shortener): NFR “redirects feel instant and almost never fail” becomes SLI = count(latency < 50ms AND status=301/302) / count(redirects), SLO = 99.9% over 30 days, error budget = 0.1% ≈ ~43 minutes of bad redirects per month at constant traffic. That single SLO forces the cache-first topology; burning the budget freezes feature launches until cache hit rate and tail latency recover.

What a nine actually costs

The interview follow-up is always "why does the fourth nine double the cost?" — so derive it instead of asserting it. A single node at 99.9% availability is down with probability 0.001. Put a second, independent replica behind failover and both are down together with probability 0.001 × 0.001 = 10−6 — the pair is at 99.9999%. That arithmetic is why the jump from 99.9% to 99.99% is bought with a second replica in another AZ: you pay roughly 2× the infrastructure, plus the parts the multiplication hides — failover automation (health checks, detection, promotion), the on-call rotation that trusts it, and regular failover testing. Each additional nine repeats the pattern at the next level up (multi-AZ → multi-region), so cost grows approximately with each nine — real cost curves vary by architecture, which is why "doubles" is a rule of thumb, not a law.

The caveat is load-bearing: the (1 − a)² math assumes the two failures are independent. Replicas that share a switch, an AZ, or the same bad deploy fail together, and the derived 99.9999% evaporates. That is why the second replica goes in a different AZ, and why the derived number is a ceiling, not a promise.

And what misclassification costs — the failure case that makes the FR/NFR split concrete:

StepWhat happened
1. Classified as an FRTeam reads "the audit log must be immutable" as a feature checkbox: an audit_events table with no UPDATE endpoint. Ships a single-node design sized for 500 QPS.
2. It was really NFRsCompliance later spells it out: 7-year retention (a durability/cost NFR) and tamper-evidence (a security NFR) — qualities, not verbs.
3. The retrofitStorage tiering to object storage for 7 years of events, WORM (write-once-read-many) storage, and hash-chaining each event to its predecessor — all of which touch how every event is written. That is a rewrite of the write path, not a patch.
4. The counterfactualCaught in the NFR pass on day one, the same requirements cost a design decision, not a migration: append-only store, hash chain in the event schema, tiering policy from the start.

Same sentence in the prompt; the classification decided whether it cost a design meeting or a quarter.

Key takeaways

🤖 Don't fully get this? Learn it with Claude

Stuck on Functional vs Nonfunctional Requirements? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **Functional vs Nonfunctional Requirements** (System Design) and want to truly understand it. Explain Functional vs Nonfunctional Requirements from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **Functional vs Nonfunctional Requirements** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **Functional vs Nonfunctional Requirements** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **Functional vs Nonfunctional Requirements** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes