System Design Interviews, Step by Step · The Method: How to Run a System Design Interview

Back-of-the-Envelope Estimation

Turn 'a lot of users' into requests per second, storage per year and bandwidth, with a handful of numbers worth memorising. Two minutes of arithmetic tells you whether one database is enough.

Create a free account to save this page, take notes and track your progress. Sign in

The problem

The interviewer says: "Assume 100 million daily active users." Is that 1,000 requests per second or 1,000,000? Does the data fit on one machine? Without a quick estimate, every later decision (cache or not, shard or not) is a guess.

Real-world analogy

Before a road trip you don't compute fuel to the millilitre. You think: 600 km, about 7 litres per 100 km, so roughly 42 litres, one tank. Rough numbers, one decision: no fuel stop needed. Estimation in interviews works the same way.

The idea

Numbers worth memorising:

Fact Rough value
Seconds in a day ~86,400 ≈ 100,000 (10⁵)
1 million requests per day ≈ 12 per second
1 billion requests per day ≈ 12,000 per second
Peak traffic 2–3× the average
A character / small number 1 byte / 4–8 bytes
A typical text record (row) 100 bytes – 1 KB
A photo / a minute of HD video ~200 KB – 2 MB / ~50–100 MB
One database server (simple queries) ~1,000–10,000 queries per second
One cache server (Redis) ~100,000 operations per second
Memory read / SSD read / same-region network round trip ~100 ns / ~100 µs / ~0.5 ms

The recipe:

  1. Traffic: daily active users × actions per user per day ÷ 100,000 = average requests per second. Multiply by 2–3 for the peak. Split reads and writes; most systems read far more than they write.
  2. Storage: new records per day × record size × 365 × years to keep. Add replication (usually ×3).
  3. Bandwidth: requests per second × response size.

Round aggressively: 86,400 becomes 100,000, 3.8 becomes 4. The goal is the order of magnitude, stated out loud.

The code

A reusable estimator. Change the inputs for any design question; this example is a photo-sharing app.

Traffic, storage and bandwidth in one goTry it yourself
def human(n, unit=""):
    for suffix, size in [("T", 1e12), ("B", 1e9), ("M", 1e6), ("K", 1e3)]:
        if n >= size:
            return f"{n / size:.1f}{suffix}{unit}"
    return f"{n:.0f}{unit}"


def human_bytes(n):
    for suffix, size in [("PB", 1e15), ("TB", 1e12), ("GB", 1e9), ("MB", 1e6), ("KB", 1e3)]:
        if n >= size:
            return f"{n / size:.1f} {suffix}"
    return f"{n:.0f} B"


DAU = 50_000_000             # daily active users
UPLOADS_PER_USER = 0.2       # photos uploaded per user per day
VIEWS_PER_USER = 30          # photos viewed per user per day
PHOTO_SIZE = 500_000         # bytes, after compression
YEARS = 5
REPLICAS = 3
SECONDS_PER_DAY = 100_000    # rounded from 86,400

writes = DAU * UPLOADS_PER_USER / SECONDS_PER_DAY
reads = DAU * VIEWS_PER_USER / SECONDS_PER_DAY
storage = DAU * UPLOADS_PER_USER * PHOTO_SIZE * 365 * YEARS * REPLICAS
egress = reads * PHOTO_SIZE

print(f"uploads:   {human(writes)}/s average, {human(writes * 3)}/s peak")
print(f"views:     {human(reads)}/s average, {human(reads * 3)}/s peak")
print(f"read:write ratio  {reads / writes:.0f}:1")
print(f"storage:   {human_bytes(storage)} over {YEARS} years (x{REPLICAS} replicas)")
print(f"bandwidth: {human_bytes(egress)}/s served at average load")

Output

uploads:   100/s average, 300/s peak
views:     15.0K/s average, 45.0K/s peak
read:write ratio  150:1
storage:   27.4 PB over 5 years (x3 replicas)
bandwidth: 7.5 GB/s served at average load

What these numbers decide: 150:1 reads to writes means caching and a CDN matter most; petabytes of photos means object storage, not a database; 15,000 views per second is too much for one database but easy for a CDN.

Common mistakes

  • Precise arithmetic. Nobody needs 578.7 requests per second. Say "about 600" and move on.
  • Estimating things that don't change the design. Skip numbers that won't affect a decision.
  • Forgetting the peak. Systems must survive the busiest hour, not the average one.
  • Mixing up bits and bytes, or MB and GB. Write units on every number.
  • Not drawing a conclusion. Every estimate should end with "so we need…" (a cache, sharding, a CDN).

Key points

  • 1 day ≈ 10⁵ seconds; 1 million per day ≈ 12 per second.
  • Traffic = users × actions ÷ 10⁵, then ×2–3 for the peak; split reads and writes.
  • Storage = records per day × size × days kept × replicas.
  • Round hard, say the order of magnitude, then state the design consequence.

Practice questions

How many requests per second is 1 billion requests per day?

Answer

About 12,000 per second on average (10⁹ ÷ ~10⁵ seconds per day ≈ 10,000; with 86,400 seconds it's ~11,600). Plan for 2–3× that at peak.

A service stores 10 million new 1 KB records a day for 3 years with 3 replicas. Roughly how much storage?

Answer

10⁷ × 1 KB = 10 GB per day; × ~1,100 days ≈ 11 TB; × 3 replicas ≈ 33 TB. Large, but still manageable with a sharded database or a few large servers.

Open in the app to mark lessons complete, take notes and track your progress.

Was this page helpful?