Typorithm · medium

Back-of-Envelope Estimation

estimationsystem-designcapacityqps
Saved on this device
Full lesson · 8 learning steps Open any exercise for focused practice
1

Step 1 of 8 · intro card

Learn Back-of-Envelope Estimation

0%

Fundamentals

Capacity estimation derives QPS from daily active users and actions per day, storage from item size times volume times retention, plus bandwidth and memory. Rounding to powers of ten keeps the math fast, and these numbers drive both the design and the interview discussion.

Back-of-envelope estimation turns a vague problem into concrete numbers. Start from daily active users (DAU). QPS is DAU times actions per user per day divided by 86,400 (seconds in a day); peak QPS is usually a few times the average.

Storage is item count times average item size times the retention period — for example, items per day times bytes per item times days kept. Bandwidth is QPS times the payload size per request, and memory sizing targets the hot set you want cached.

Round aggressively to powers of ten so the arithmetic stays fast: treat 86,400 as ~10^5, a day as ~100k seconds. The goal is the right order of magnitude, since these numbers drive the design choices and the interview conversation.

01

QPS = DAU x actions/day / 86,400.

02

Storage = items x size x retention.

03

Round to powers of ten for fast math.

estimate:
  dau: 100M-users
  qps: dau-times-actions-over-86400
  storage: items-times-size-times-years
  bandwidth: qps-times-payload
  memory: cache-hot-set

Read the implementation

Connect each part of the code to the concept before you type.

1. Daily active users

DAU — daily active users — is the starting point most other numbers are derived from.

dau: 100M-users

2. QPS formula

QPS comes from DAU times actions per user per day, divided by 86,400 seconds in a day.

qps: dau-times-actions-over-86400

3. Storage estimate

Storage is item count times item size times the retention period in years.

storage: items-times-size-times-years

4. Bandwidth estimate

Bandwidth is QPS times the payload size per request.

bandwidth: qps-times-payload

5. Memory for cache

Memory sizing targets the hot set — the frequently accessed data you want to keep cached.

memory: cache-hot-set

A complete learning loop

01

Understand

Read the concept map and follow the code breakdown.

02

Reconstruct

Type the implementation, repair mistakes and work through every recall exercise.

03

Verify

Use the final check without hints; revisit weak concepts in short practice sessions.

Back-of-Envelope Estimation: Lesson & Practice · Typorithm | ApplyDjinn