◐ ai-teacher

🧮 Aptitude & Reasoning · Chapter 10

Estimation: order-of-magnitude answers

"How many events per second?" is not a trick question. It is a test of whether you can be roughly right in thirty seconds instead of precisely stuck.

Study this lesson free in the app →

The basics

Estimation (a Fermi estimate) is getting a number that is roughly right — within a factor of 2 or 3 — in under a minute, from things you can guess.

The problem it solves: in design rounds and in real planning you rarely have the exact figure, but you still have to decide. Is it 100 events a second (one Postgres is fine) or 100,000 (you need Kafka and partitions)? That decision only needs the order of magnitude, not the third decimal.

The mental model: break the unknown into a chain of guessable pieces — users × actions per user × bytes per action — round each one hard, multiply, and keep the units visible so they catch your mistakes. Then size for the peak, not the average.

Words you must know 5

Order of magnitude
the power of ten; being 20% off is fine, 100× off is a different system
Anchor
a number you never look up, like 86,400 seconds in a day (≈10⁵)
Peak factor
how much busier the busiest hour is than average, usually 3–5×
Sensitivity
which assumption moves the answer most; name it out loud
Sanity check
compare your answer against something you already know

Explained

"Roughly how much storage does a year of driver-location pings need?"

The wrong answer is "I'd need the exact ping rate". The right answer starts: "Let's say 50,000 active drivers, one ping every 5 seconds…" and lands within a factor of two, out loud, in under a minute.

Nobody is checking your arithmetic. They are checking whether you can make the unknown tractable.

The builder's glance

Ask an experienced builder how much concrete a patio needs and they look at it for three seconds and say "about two cubic metres".

They have not measured. They have a chain of anchors — a slab is roughly this thick, a metre square is roughly this much — and they multiply.

They are also never wildly wrong. Not 0.2, not 20. That is the actual skill: not accuracy, but staying inside the right order of magnitude. Being out by 20% costs nothing. Being out by 100× means you designed the wrong system.

The anchors worth memorising

Estimation is multiplication plus a handful of numbers you never have to look up.

TIME
  86,400 s in a day      ≈ 10^5    (a very useful rounding)
  2.6 million s in a month
  31.5 million s in a year ≈ 3×10^7

SIZE
  a small JSON event      ≈ 1 KB
  1 million × 1 KB        = 1 GB
  1 billion × 1 KB        = 1 TB
  Parquet vs raw JSON     ≈ 5-10× smaller

RATE
  1 per second            ≈ 86 K/day  ≈ 2.6 M/month
  100 per second          ≈ 8.6 M/day
  1,000 per second        ≈ 86 M/day  ≈ 31 B/year

SHAPE OF DEMAND
  peak ≈ 3-5× the average
  ~80% of traffic in ~30% of the hours

The single most valuable one: 1 per second is about 86,400 a day. Round it to 100,000 and almost every rate question becomes mental arithmetic.

Size it in sixty seconds

RideFlow operates in 12 Indian cities.

Estimate the storage for one year of raw driver-location pings, and the peak events per second.

Why interviewers keep asking this

Every system design round contains a sizing question, because the answer determines the architecture:

Candidates who skip the estimate design for the wrong tier and cannot tell they have. The estimate is what makes "do we need Kafka?" answerable instead of a matter of taste.

And the follow-up is always about cost: 2 TB/year in cloud object storage is trivial money; 2 TB/year queried repeatedly in a warehouse is not. Storage is cheap, repeated compute is not — that sentence belongs in your answer.

1 per second ≈ 100,000 a day. A year ≈ 3×10⁷ seconds.

1 million KB = 1 GB. 1 billion KB = 1 TB.

Round to one significant figure, state every assumption, then multiply by a peak factor of 3–5.

Gotchas

The shape of a good answer

"How many events per second will this handle?"

"Let me size it. Assume 50,000 active drivers and a ping every 5 seconds — that's 10,000 a second if everyone's online, but realistically about a third are, so call it 3,000 average. Peak in the evening or in rain is maybe four times that, so I'd design for around 12,000 a second."

"At 200 bytes an event that's about 20 TB of raw a year, or 2 TB in compressed Parquet — cheap to keep. The write rate is well past what I'd want in an operational database, so this goes to Kafka and lands in object storage."

"I'd want to check the real ping interval and the concurrency ratio, because those two numbers move the answer most — but the architecture wouldn't change unless we're off by more than 10×."

The last sentence is what separates it: naming which assumption the answer is most sensitive to, and how wrong you'd have to be for the decision to flip.

Words to know

Order of magnitudeA factor of ten. Being right to the nearest 10× is usually enough to choose an architecture.
Fermi estimateDecomposing an unknown into guessable factors and multiplying.
Peak factorHow much busier the busiest moment is than the average — typically 3-5×.
Concurrency ratioWhat fraction of your users are active at any one moment.
DownsamplingKeeping full resolution briefly, then aggregating older data to cut storage.
SensitivityWhich assumption, if wrong, changes the answer most — the one worth verifying first.

In two minutes

Test yourself

1. One event per second is roughly how many per day?

  1. 8,600
  2. 86,000
  3. 860,000
  4. 8.6 million
Show the answer

86,000 — 86,400 seconds in a day. Rounding to 100,000 makes almost every rate question mental arithmetic.

2. You estimate 3,000 events/sec on average. What should you design for?

  1. 3,000/sec
  2. About 4x that — systems fail at peak, not at average
  3. 300/sec
  4. It doesn't matter
Show the answer

About 4x that — systems fail at peak, not at average — Peak is typically 3-5x average. Capacity sized on the mean falls over exactly when it matters most.

3. A billion events at 1 KB each is roughly…

  1. 1 GB
  2. 1 TB
  3. 1 PB
  4. 100 GB
Show the answer

1 TB — A million KB is a GB; a billion KB is a TB. Worth knowing cold — it appears in every sizing question.

4. Which is the strongest thing to add after giving an estimate?

  1. A more precise number
  2. Which assumption the answer is most sensitive to
  3. An apology for guessing
  4. A different estimate
Show the answer

Which assumption the answer is most sensitive to — It shows you know where the uncertainty lives and what you'd measure first — the actual engineering judgement being tested.

5. A payments network handles about 10 billion transactions a month. Roughly what is the average per second?

  1. About 400
  2. About 40,000
  3. About 4,000
  4. About 400,000
Show the answer

About 4,000 — A month ≈ 2.6 million seconds. 10¹⁰ / 2.6×10⁶ ≈ 3,800, so about 4,000/sec. The 40,000 option comes from using 2.6×10⁵ — dropping a zero in the month anchor is the most common slip.

6. A service writes 1,000 events/sec at 500 bytes each. Roughly how much raw data per day?

  1. ~43 GB
  2. ~4 GB
  3. ~430 GB
  4. ~4 TB
Show the answer

~43 GB — 1,000 × 500 B = 500 KB/s. × 86,400 s ≈ 43 GB/day. Using 10⁵ seconds gives 50 GB — close enough; that's the point of the rounding anchor.

There are 8 questions, 3 puzzles and 6 recall cards for this lesson in the app — the recall cards come back on later days, just before you would forget.

Learn it so it stays. Read it, test yourself, then recall it on two different days. The app schedules that for you, free.

Start this lesson →