Catalog My learning Blog
System Design Interview Prep: Framework and Questions · Phase 1 · Lesson 3 · 4 min read

Back-of-the-Envelope Estimation for Interviews

On this page
  1. Why estimation matters in a system design interview
  2. How to estimate QPS, storage and bandwidth
  3. Worked example: estimating a Twitter-like feed
  4. Latency numbers every engineer should know
  5. What makes a strong estimate
  6. Check yourself

Why estimation matters in a system design interview

10,000 requests a day and 10,000 requests a second need completely different systems, and interviews reward noticing which one you face. The first runs on one small server. The second needs load balancing, caching and probably several databases. Estimation tells you which one you're building, and the interviewer wants to see you find out instead of guess.

Precision doesn't matter. Being within a factor of ten, quickly, does.

How to estimate QPS, storage and bandwidth

Start from what you confirmed in the requirements:

  1. Requests per second (QPS): daily active users × actions per user per day ÷ seconds per day.
  2. Peak QPS: average × 2 to 3. Traffic is never flat across a day.
  3. Storage: size of one item × items per day × how long you keep them.
  4. Bandwidth: QPS × size of each response.

Round hard so you can do it in your head:

  • A day is about 100,000 seconds (really 86,400).
  • A year is about 30 million seconds.
  • 1 million requests a day is about 10 per second.

Worked example: estimating a Twitter-like feed

Assume 200 million daily users, 2 posts each per day, 280 bytes of text per post, 1 in 10 posts with a 1 MB image, and 10 feed views per user per day.

Code
Posts per day     200,000,000 users × 2              = 400,000,000 posts/day
Average writes    400,000,000 ÷ 100,000 s            ≈ 4,000 writes/s
Peak writes       4,000 × 2.5                        ≈ 10,000 writes/s
Text per day      400,000,000 × 280 bytes            ≈ 112 GB/day
Images per day    400,000,000 × 0.1 × 1 MB           ≈ 40 TB/day
Images per year   40 TB × 365                        ≈ 15 PB/year
Feed reads        200,000,000 × 10 ÷ 100,000 s       ≈ 20,000 reads/s, about 50,000 at peak
Image bandwidth   20,000 views/s × 2 images × 1 MB   ≈ 40 GB/s leaving your servers

Now use it. Images are about 350 times more data than text, so they don't belong in the same database as posts: put them in object storage, and keep only the image URL in the post record. At 15 PB a year, plan lifecycle rules that move old images to cheaper storage tiers. The bandwidth line (assuming each feed view loads two images) shows why a CDN in front of those images isn't optional. Reads run five times higher than writes and each view returns many posts, so the read path needs a cache; Day 7 builds that feed. And 10,000 writes per second at peak is more than you'd want on one relational database primary, so you'll need to talk about sharding or an asynchronous write path. Every one of those decisions came from the numbers, before drawing a single box.

For a Twitter-like feed with 200 million daily users posting two tweets each, that is 400 million tweets a day, about 4,000 writes per second on average and roughly 10,000 at peak. Text needs about 112 GB a day, while images at a tenth of tweets and 1 MB each need about 40 TB a day.
For a Twitter-like feed with 200 million daily users posting two tweets each, that is 400 million tweets a day, about 4,000 writes per second on average and roughly 10,000 at peak. Text needs about 112 GB a day, while images at a tenth of tweets and 1 MB each need about 40 TB a day.

Latency numbers every engineer should know

During the deep dive you'll be asked whether something is fast enough. A number beats "it should be fine". Orders of magnitude are enough:

OperationRoughly
Read from memory100 nanoseconds
Read 4 KB from an SSD100 microseconds
Round trip inside one data center0.5 milliseconds
Disk seek on a spinning drivea few milliseconds
Round trip between continents100 to 150 milliseconds

These figures trace back to Jeff Dean's "Latency Numbers Every Programmer Should Know", and modern hardware has shifted some of them. The relationships are what matter: memory is about a thousand times faster than SSD, and a cross-continent call costs as much as hundreds of in-datacenter calls.

What makes a strong estimate

  • Assumptions said out loud. "I'll assume 20 percent of users post daily." The interviewer can correct you, and your reasoning is visible.
  • A decision attached to every number. "That's 40 TB a day, so images go to object storage" is worth far more than "that's 40 TB a day."
  • Speed. If you're three minutes into one multiplication, round more.

Check yourself

50M × 20 = 1 billion requests a day ÷ 100,000 s ≈ 10,000 per second on average, so roughly 20,000 to 30,000 at peak.

Use object storage with tiering or compression rather than a database, plan for retention or deletion rules, and avoid replicating everything at full cost.

The roughly 15 percent error doesn't change any design decision, because estimates are only meant to land within an order of magnitude. A round number lets you calculate quickly in your head while talking, which keeps the interview moving and makes your arithmetic easy for the interviewer to follow.

The system is read-heavy, so the read path gets attention first: caching, a CDN for media, maybe read replicas. The write number is a separate question, and it decides whether one database primary is enough.

Roughly: a memory reference in nanoseconds, an SSD random read in tens to hundreds of microseconds, a round trip within a data center around half a millisecond, and a cross-continent round trip around 100 to 150 milliseconds. They let you judge quickly whether a design's calls fit a latency target.