SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
Part 6: Distributed Systems
Part 7: Advanced Data Topics
Part 8: Operations and Security
Part 9: Estimation and Interview Method
  • Requirements Gathering
  • Back-of-the-Envelope Math in Practice
Part 10: Case Studies
System Design/Estimation and Interview Method/Requirements and Estimation

Back-of-the-Envelope Math in Practice

Worked estimates for real designs (a chat app, a video site, a URL shortener) and the shortcuts that keep them quick.

⏱ 15 min readIntermediateMust KnowInterview FavouriteHas visualizer
SummaryConceptReal-Life ExampleWhy?Where?How It WorksStepsKey TermsPros & ConsMistakesReal WorldRead NextInterview Q&ACheat-Sheet

01Quick Summary

The earlier page on Back-of-the-Envelope Estimation gave you the round-number rules. This page is about using them in order: one repeatable workflow, applied to three real designs, ending in a decision.

  • The workflow: state assumptions, then traffic, then storage, then bandwidth, then cache, then servers, then a sanity check.
  • The goal is a decision, not a number: one database or many? Is a cache needed? Do we need a CDN?
  • Round hard, say it out loud, and write the units next to every number.

02Concept: What is it?

An estimate is a chain of small, simple multiplications. Each link is easy. The risk is in the order you do them, the units you carry, and the steps you forget (peak traffic, copies, bits versus bytes). A fixed routine removes that risk.

The seven-step routine

Estimate in this order
1️⃣Assumeusers, actions, size
→↓
2️⃣Trafficaverage and peak QPS
→↓
3️⃣Storageper day, year, copies
→↓
4️⃣Bandwidthin and out, bits
→↓
5️⃣Cache and servers80/20, QPS per server
→↓
6️⃣Sanity checkdoes it look real?
→↓
7️⃣Decideshard? cache? CDN?
Each step uses the one before it. The last step turns numbers into design decisions.

You already know 1 day ≈ 100,000 seconds and the size units from the earlier page. Here are the shortcuts you build on top of them. Each one is checked, so you can trust it.

ShortcutCheckUse it for
1 million per day ≈ 12 per second1,000,000 / 86,400 = 11.6Daily requests to QPS
100 million per day ≈ 1,200 per second100 x 11.6 = 1,160Large daily counts
1 billion per day ≈ 12,000 per second1,000 x 11.6 = 11,600Very large daily counts
1 KB x 1 million = 1 GB1,000 B x 1,000,000 = 10^9 BStorage of small records
1 MB x 1 million = 1 TB10^6 B x 10^6 = 10^12 BStorage of medium files
1 GB x 1 million = 1 PB10^9 B x 10^6 = 10^15 BStorage of large files
1 year ≈ 3 x 10^7 seconds, or 365 days365 x 86,400 = 31.5 millionYearly numbers
Gbps = bytes per second x 8 / 10^91 GB/s = 8 GbpsBandwidth from bytes

03Real-Life Example

🍵Catering for a Festival
You plan food for a festival. First you guess the crowd and how much each person eats (the assumptions). Then you work out the rush at noon, not the average (peak). Then how many trucks to keep food cold (storage), how wide the entrance must be (bandwidth), and how many cooks to hire (servers). Last, you check: “Does 20 tonnes of food for 5,000 people sound right?” If not, you find the mistake before you order.
Festival food
System estimate
Guess the crowd and the plate size
Assumptions: users, actions, item size
The noon rush
Peak QPS
Cold storage trucks
Storage with copies
Width of the gates
Bandwidth
Pre-cooked popular dishes
A cache for the hot 20%
Number of cooks
Number of servers
Does 20 tonnes sound right?
Sanity check

Three full examples

All numbers below are illustrative assumptions, not real company figures. In every case we state the inputs first, then compute.

StepURL shortenerChat appPhoto sharing
Assume50 M daily users, 0.1 new links each, 100 reads per write, 500 B per record50 M daily users, 40 messages each, 2 reads per message, 500 B each20 M daily users, 0.5 photos each, 50 views per photo, 1 MB each
Writes per day50 M x 0.1 = 5 M50 M x 40 = 2 B20 M x 0.5 = 10 M
Reads per day5 M x 100 = 500 M2 B x 2 = 4 B10 M x 50 = 500 M
Average QPS (/ 100,000)50 writes + 5,000 reads20,000 writes + 40,000 reads100 writes + 5,000 reads
Peak QPS (x 3)150 writes + 15,000 reads60,000 writes + 120,000 reads300 writes + 15,000 reads
Storage per day5 M x 500 B = 2.5 GB2 B x 500 B = 1 TB10 M x 1 MB = 10 TB
Total, 5 years x 3 copies2.5 GB x 365 x 5 x 3 ≈ 14 TB1 TB x 365 x 5 x 3 ≈ 5.5 PB10 TB x 365 x 5 x 3 ≈ 55 PB
Peak bandwidth out15,000 x 500 B = 7.5 MB/s = 0.06 Gbps120,000 x 500 B = 60 MB/s = 0.5 Gbps15,000 x 1 MB = 15 GB/s = 120 Gbps
Cache (20% of a day of reads)500 M x 500 B x 0.2 = 50 GB4 B x 500 B x 0.2 = 400 GB500 M x 1 MB x 0.2 = 100 TB (too big: use a CDN)
DecisionOne small database holds it. Reads at 15,000/s need a cache and replicas.Writes at 60,000/s and petabytes: shard by conversation.Bandwidth and storage dominate: object storage plus a CDN.
📝Why the answers look so different
Same method, three different bottlenecks: read rate (URL shortener), write rate and storage (chat) and bandwidth (photos). The numbers tell you where to spend your design time.

04Why Do We Need It?

🧭Numbers pick the design
Your answer to “do I need to shard?” should come from a number, not a feeling.
🎯Find the bottleneck
The biggest figure shows what to design first.
🪪Shows you can reason
Interviewers value clear steps more than a perfect answer.
🧯Catch absurd results
A sanity check finds a wrong zero before it ruins the design.
💵Estimate cost
Storage, bandwidth and servers become a monthly bill.
🗣️Easier to explain
A fixed order gives you something to say while you think.
Do the same steps in the same order every time. The routine is the skill.

05Where Do We Use It?

🎤Design interviews
Right after requirements and before the high-level design.
📝Design documents
A short capacity section: expected traffic, data size and growth.
🧮Capacity planning
How many machines to order before a launch (see the Capacity Planning topic).
🧪Load tests
Your estimate becomes the target number for the test.
💰Cloud cost reviews
Quick checks before choosing a storage class or a CDN.
🔍Incident reviews
Comparing the estimate with what really happened shows which assumption was wrong.

06Types / Parts / How It Works

What each number is for

NumberFormulaDecision it drives
Average QPS(users x actions per user per day) / 100,000Baseline server count
Peak QPSAverage x 2 to 3 (a spiky service: up to 10)What you must survive
Read:write ratioReads per writeCache and replicas (high), partitioning and queues (low)
Storage per yearWrites per day x size x 365One database, or sharding and tiers
Total storagePer year x years kept x copiesThe cost of keeping data, and when to archive
Bandwidth outPeak reads x size x 8 bitsNetwork limits and whether a CDN is needed
Cache size0.2 x one day of read data (80/20 rule)Memory per cache node and how many nodes
ServersPeak QPS / QPS per server, at least 2Fleet size and headroom

Rules of thumb for the decisions

If you see...It suggests...Why
Peak writes of a few thousand per second or lessOne primary database can workTypical limit of one well-tuned primary (very rough)
Reads above a few thousand per secondA cache and read replicasOffload the database
Data past a few terabytesPlan sharding or distributed storageOne machine runs out of disk and memory
Outbound traffic past about 1 GbpsA CDN for static or large contentCheaper and closer to users
Cache needs more memory than one machineDistributed cache or cache only the hottest partMemory is the limit
⚠️These limits are rough
Real limits depend on hardware, query shape and software. Use the rules to choose a direction, then say, “I would confirm this with a load test.”
Traffic Storage Bandwidth
VisualizerChange the inputs and see every number movePick a scenario, then drag the sliders. Watch the verdicts change from green to red, and read the arithmetic panel to see each step. Switch between 100,000 and 86,400 seconds to see the cost of rounding.
Scenario
Seconds in a day
Average QPS
5.05 K
reads + writes
Peak QPS
15.2 K
x 3 the average
Storage per year
913 GB
one copy
Total kept
13.7 TB
5 yr x 3 copies
Peak bandwidth out
0.06 Gbps
reads x size x 8
What this means
Database writes
Peak 15 writes/s. One primary database can take this.
Reads
Peak 15 K reads/s. Put a cache in front, and add read replicas.
Storage
13.7 TB in total. Spread it over many machines (sharding).
Bandwidth
Peak 0.06 Gbps out. A normal network link is enough.
App servers
16 servers at 1 K requests/s each (never fewer than 2, so one failure does not stop you).
Show the arithmetic (say it out loud like this)
  1. Writes per day = users x links each = 50 M x 0.1 = 5 M
  2. Reads per day = writes x read:write ratio = 5 M x 100 = 5 M
  3. Seconds in a day = 100,000 (rounded from 86,400)
  4. Average QPS = per day / seconds = 5 M / 1 K = 50 writes/s, and 5 M / 1 K = 5 K reads/s
  5. Peak QPS = average x 3 = 5.05 K x 3 = 15.2 K requests/s (15 writes, 15 K reads)
  6. Storage per day = writes x size = 5 M x 0.5 KB = 2.5 GB
  7. Storage per year = per day x 365 = 913 GB (one copy)
  8. Total kept = per year x 5 years x 3 copies = 13.7 TB
  9. Peak bandwidth out = peak reads x size = 15 K x 0.5 KB = 7.5 MB/s, and x 8 bits = 0.06 Gbps
  10. Cache = 20% of one day of reads (the 80/20 rule) = 0.2 x 5 M x 0.5 KB = 50 GB
  11. App servers = peak QPS / 1 K per server = 15.2, rounded up and never below 2 = 16
Nothing is extreme, but a cache, replicas or a CDN will help. Add them only where a number asks for it.

The rounded day (100,000 s) is 14% off the exact one (86,400 s) for QPS. That is fine for an estimate. All inputs are illustrative assumptions, not real company statistics. Sizes use 1 KB = 1,000 bytes. The limits behind the verdicts (5,000 writes/s, 2,000 and 20,000 reads/s, 10 TB, 1 PB, 1 and 10 Gbps, 1 K requests/s per server) are rough rules of thumb.

07How to Use It / Steps / Implementation

Doing it live, out loud

  1. 1
    State the assumptions first
    “I will assume 50 million daily users, 40 messages each, 500 bytes per message.” Write them in a column.
  2. 2
    Convert to a daily count
    Users x actions. Keep units next to numbers: “2 billion messages per day”.
  3. 3
    Convert to QPS
    Divide by 100,000. Then multiply by 2 or 3 for peak. Say which one you will design for.
  4. 4
    Compute storage
    Writes per day x size, then x 365, then x years kept, then x copies. Do each multiplication on its own line.
  5. 5
    Compute bandwidth
    Peak reads per second x size. Multiply by 8 only if you need bits.
  6. 6
    Size the cache and the fleet
    Cache about 20% of a day of reads. Servers = peak QPS divided by what one server handles, at least 2.
  7. 7
    Sanity check
    Compare with something you know. Does 5 PB for a chat app sound possible? Does 200 servers for 120,000 QPS?
  8. 8
    Say the decision
    “Writes at 60,000 per second means I should shard by conversation.” End on what the number means.
💡Round hard, keep one digit
Use 1, 2, 3, 5 and 10 times a power of ten. 86,400 becomes 100,000. 11.6 becomes 12. False precision (such as 11,574 QPS) wastes time and suggests accuracy you do not have.
💡Narrate while you compute
Silence looks like being stuck. Saying, “5 million times 100 is 500 million, divided by 100 thousand is 5 thousand” shows a clear mind, and lets the interviewer correct you early.

08Key Terms to Know

TermMeaning in easy words
QPSQueries (requests) per second
Peak QPSThe busiest rate you must handle, often 2 to 3 times the average
Read:write ratioHow many reads for each write
Replication factorHow many copies of each piece of data are kept
BandwidthHow much data moves per second, often in bits (Gbps)
EgressData leaving the system, which is often what you pay for
80/20 ruleAbout 20% of the data gets about 80% of the reads, so cache that part
HeadroomSpare capacity kept for spikes and failures
Sanity checkComparing a result with something you know to catch a big mistake
Order of magnitudeA factor of ten. Estimates aim to be right within this
False precisionWriting many digits that the inputs do not support

09Pros, Cons and Trade-offs

✅ Pros
  • Turns choices into numbers
  • Finds the bottleneck early
  • Easy to explain and check
  • Cheap: needs only a pencil
  • Catches over-building and under-building
⚠️ Cons
  • Inputs are guesses
  • A wrong assumption spreads through every step
  • Ignores real-world quirks (hot keys, uneven load)
  • Rounding adds error
  • Can feel like a ritual if not tied to a decision

Trade-offs

ChoiceWe gainWe lose
Round to powers of tenSpeed and clarityUp to a few tens of percent error
Design for peakSurvives spikesSpare servers most of the day
Count all copiesA true storage and cost figureA bigger, scarier number
Skip bandwidthSaves timeMay miss that a CDN is needed
More stepsA more complete pictureLess time for the design itself

10Common Problems and Mistakes

Common mistakes

  1. Bits versus bytes. File sizes are in bytes, network speeds in bits. Multiply bytes per second by 8 for Gbps.
  2. Forgetting peak. The average hides the spike. Design and size servers for the peak.
  3. Forgetting copies. Replication multiplies storage by 2, 3 or more.
  4. Mixing units. KB with MB, per day with per second. Write units on every line.
  5. False precision. Six digits from guessed inputs mean nothing. Round to one digit.
  6. Skipping the sanity check. A missing zero turns a small system into a giant one.
  7. Counting reads as writes. Storage grows from writes, not from reads.
  8. Stopping at the number. An estimate with no decision attached has not helped anyone.

Things to watch

🔥Uneven load
Some keys, users or times are far hotter than the average.
📈Growth
Say what the numbers will be in a year, if the interviewer asks.
🧮Overhead
Indexes, metadata and compression change the real size.
🧪Check with a test
A rough estimate should be confirmed with a load test before launch.

11Real-World Examples

📄Design docs
A short “scale and capacity” section lists expected QPS and data growth.
☁️Cloud cost calculators
They take storage, requests and outbound data as inputs, the same figures you just computed.
🧪Load testing
Teams test at 2 to 3 times the expected peak.
🧮Capacity reviews
Before big events, teams re-estimate and add headroom.
🎤Interview rounds
Estimation is a standard, scored part of the round.
🧯Postmortems
“We assumed 10 times less traffic” appears often.
Mini case: a number changes the design
🖼️Photo app1 MB per photo
→↓15,000 views/s at peak
📡15 GB/s = 120 Gbpsfar past one link
→↓decision
🌍Object storage + CDNserve from the edge
Same app, one assumption changed.

12Related Topics to Read Next

Back-of-the-Envelope Estimation→

The rules and units this page builds on.

Numbers Every Engineer Should Know→

Latency and size figures for the sanity check.

Requirements Gathering→

The step before: where your assumptions come from.

The 7-Step Interview Framework→

Where estimation sits in the whole interview.

Capacity Planning→

The real-world version of this skill.

Talking About Trade-offs and Bottlenecks→

What to say once the numbers point to a bottleneck.

Latency vs Throughput vs Bandwidth→

Getting the units and meanings right.

13Interview Questions with Short Answers

14Quick Revision Cheat-Sheet

  • ✔Order: assume, traffic, storage, bandwidth, cache and servers, sanity check, decide.
  • ✔QPS: per day / 100,000. 1 M per day ≈ 12 per second.
  • ✔Peak: average x 2 to 3 (spiky: x 10).
  • ✔Storage: writes x size x 365 x years x copies.
  • ✔Bandwidth: peak reads x size, then x 8 for bits.
  • ✔Cache: about 20% of a day of reads.
  • ✔Check units on every line, and round to one digit.
  • ✔One line: “Assume, calculate in order, sanity check, then say what the number means for the design.”
← Previous
Requirements Gathering
Next →
The 7-Step Interview Framework