Skip to content
HLD Learn/Welcome to the Course
Browsing as a guest. Sign in to save your progress and earn XP as you complete chapters.

How to Think Like a System Designer

6 min read

You'll learn to

  • -Distinguish functional from non-functional requirements, with examples of each
  • -Explain why every design starts with a rough estimate, and do one with round numbers
  • -Have a repeatable first move for any design problem: the 5-step loop
  • -Use a few shortcuts for fast back-of-envelope arithmetic

Tip: the highlighter is on - just select any text below to mark it. Use the highlighter button up top to change color or turn it off. Highlights are saved on this device only. Log in to save them to your account instead.

Before you place a single box on a canvas, a system designer answers two questions: "what does this system need to do?" and "how much of it, how fast, for how many people?" Skipping either question is the single most common reason a design falls apart, whether under interview scrutiny or real production traffic.

An Analogy: Before the Architect Draws the Plan

Before an architect draws a floor plan, they ask questions. How many people will live here? What is the budget? Does anyone use a wheelchair? What is the climate? A house for two and a hotel for 400 are not the same building with more rooms: they need different foundations, lifts and fire exits. The questions come first because the answers decide the structure. System design works the same way.

  • -What the client wants the building to do is the functional requirements.
  • -How many people, how safe, how durable is the non-functional requirements.
  • -Measuring the plot and counting the occupants is estimation.
  • -The floor plan is the high-level design.
  • -The beam that will fail first under load is the bottleneck.
  • -Choosing a cheaper material and accepting its limits is the trade-off.

Functional vs. Non-Functional Requirements

Functional requirements are the verbs: "users can post a photo," "the system sends a notification within 5 seconds," "an admin can ban a user." They describe behavior. Non-functional requirements are the constraints those behaviors must survive: how many users, how many requests per second, what latency is acceptable, what happens during a traffic spike, what happens when a server dies. A design that nails the functional requirements but ignores the non-functional ones is a prototype, not a system.

  • -Functional describes what the system does: features, user flows, business rules.
  • -Non-functional describes how well it does it: scale, latency, availability, consistency, cost.
  • -Non-functional requirements are what turn "a working demo" into "a system that survives Black Friday."

Why Estimate Before You Design

A system serving 1,000 users and a system serving 100 million users are not the same system with more servers bolted on; they are architecturally different. A single PostgreSQL instance is the right answer at the first scale and actively wrong at the second. That is why every serious design starts with rough, order-of-magnitude estimation: how many users, how many requests per second, how much data, growing at what rate. You do not need precision. You need to know whether you are building for a thousand users or a billion, because that decides everything downstream.

A Worked Estimate

Here is what an estimate looks like in practice. Say you are asked to design the notification system for an app with 10 million daily users, and each user receives about 5 notifications a day. That is 10,000,000 x 5 = 50 million notifications a day. A day has 86,400 seconds, so the average is 50,000,000 / 86,400, about 580 per second. Traffic is not flat, so assume the peak is 5 times the average: roughly 2,900 per second. If each notification is stored for 30 days at about 1 KB, that is 50 GB a day and 1.5 TB in total.

What did the numbers tell you, before any box was drawn? About 3,000 messages a second at the peak is easy for a pool of workers fed by a queue, so the design does not need exotic machinery. The storage figure, 1.5 TB, is the part that grows, so you should decide early how long to keep notifications. And the real constraint will probably be the rate limits of the push services you send through. An estimate tells you where to look.

Shortcuts for Quick Mental Math
1 day, about 100,000 seconds
It is really 86,400. Round it up and the answer is close enough
1 million a day, about 12 a second
1,000,000 / 86,400 is about 11.6
1 KB x 1 billion = 1 TB
Each step from KB to MB to GB to TB is a factor of 1,000
Peak, 2 to 5 times the average
A design has to survive the peak, not the average

You do not need precision, only the right order of magnitude. If you are off by 30%, nothing changes. If you are off by a factor of 100, the whole architecture changes. For a longer list of reference numbers, the Wiki card below is a good one to keep open while you practice:

From the Wiki🧮 Back-of-Envelope Estimation

Fast, rough calculations to size your system. Used in system design interviews to justify technology choices.

A civil engineer doesn't design the Golden Gate Bridge before estimating "hmm, ~100,000 cars per day, each weighing ~2 tons, so load = ~200M kg/day". These rough numbers drive the design. You do the same for software systems.

Before designing ANY system, estimate: (1) How much data? (2) How many QPS (queries per second)? (3) What is the acceptable latency?

Key Units: 1 million = 10^6, 1 billion = 10^9. Power of 2: 1KB=10^3, 1MB=10^6, 1GB=10^9, 1TB=10^12. Always round aggressively to enable mental math.

Estimation Example - Twitter Feed: 300M daily users, 50% post per day = 150M tweets/day = ~1,750 tweets/second. Average tweet = 140 chars + metadata ≈ 500 bytes. Storage per day = 1750/s × 500B × 86400s ≈ 75GB/day. In 5 years ≈ 140TB. This tells you: need distributed storage, need partitioning by tweet_id.

Traffic estimation: Daily active users (DAU) × actions per day / 86,400 seconds = QPS. For peak: multiply by 2-3x (reads often 100x writes). Example: 10M DAU - 10 reads/day / 86400 ≈ 1,157 QPS average, 3,500 peak.

Storage estimation: Data size - users - retention period. Example: Instagram - 100M users upload 1 photo/week, average 2MB per photo. Per week: 100M × 2MB = 200TB. Per year: 10PB. This drives: object storage (S3), CDN (CloudFront), image compression pipeline.

  • -In interviews, never skip estimation - it justifies every technology choice you make.
  • -QPS under 100: single server. 100-1000: single optimized server. 1000+: horizontal scaling needed.
  • -Storage under 1TB: single server/managed DB. 1TB-10TB: managed cluster. 10TB+: distributed storage.
  • -Always ask: read-heavy or write-heavy? 80:20 read:write is typical social media.
  • -Cache ratio: if 80% of traffic is to 20% of data, caching has a massive ROI.
Read the full Wiki deep-dive (+1 more)

A Repeatable First Move

When you are handed a vague prompt, "design a notification system", resist the urge to start drawing boxes immediately. Instead, work through this sequence, which every chapter in this course implicitly follows:

Applied to the notification system, the five steps look like this. Clarify what kinds of notification are in scope and what is not. Estimate as above. Sketch client to API to queue to workers to push service. Name the bottleneck: the push service's limits and storage growth. State the trade-off, such as accepting that a notification may arrive a few seconds late in return for never blocking the sender.

  • -1. Clarify functional scope: what must it do, and just as importantly, what is explicitly out of scope?
  • -2. Estimate scale: users, QPS, data volume, growth rate.
  • -3. Sketch the high-level flow: client to server to storage, in the simplest shape that could work.
  • -4. Identify the bottleneck: which single piece will break first as scale grows?
  • -5. Discuss the trade-off: what did you sacrifice (cost, consistency, complexity) to fix that bottleneck?

This 5-step loop is exactly what you will practice, piece by piece, for the rest of the course, and it is exactly what the HLD Lab's missions and scoring are checking for.

The chapter at the end of this module, How to Structure Any Design Answer, shows how to fit this loop into the time available in an interview.

Interview Signal

"Design a URL shortener." What's the first thing you say?

Weak Answer

"Okay, I'll hash the long URL to generate a short code, store it in a database, and redirect on lookup." Technically not wrong, but it answers a question nobody asked yet, and it's the same answer whether this system serves 100 users or 100 million.

Strong Answer

"Before I design anything, are we talking a few thousand links a day, or Bit.ly scale? Is a link permanent, or does it expire? Do we need click analytics?" Only after those answers does a concrete design get proposed, and it looks different depending on the answers.

Check Yourself1 / 6

Which of these is a non-functional requirement?

Discussion0

Join the Discussion

Sign in to leave comments, reply to others, or like insights.

Sign In to ScaleDojo

No comments yet. Be the first to start the thread!