Stage 0 · Interview method · Easy · 15 min

Capacity and cost estimation

Turn users and actions into requests per second, storage and bandwidth. Then turn those into servers and monthly cost, and use the numbers to justify and right-size your design.

What each interview level is expected to know

Learn first: Latency, throughput and availability

After this lesson you can:

  • Turn daily users and actions into requests per second, at average and at peak.
  • Estimate storage, bandwidth and cache size with round numbers.
  • Turn the load into a number of servers and a rough monthly cost.

Start here

See it in 60 seconds

From daily users to requests a second

Capacity estimation turns a guess about users into requests a second, a busiest-hour peak and storage, close enough to choose the design.

Scene 1 of 6 · Start from users

Start from what you can guess: say 10,000,000 people use the app each day.

The napkin maths
StepWorking
Daily users (highlighted)10,000,000
Average requests a second
not shown yet
Busiest-hour requests a second
not shown yet
  1. Start from users. Start from what you can guess: say 10,000,000 people use the app each day.
  2. Requests a day. If each makes about 10 requests, that is 100,000,000 requests a day.
  3. Divide by a day. A day has 86,400 seconds, so that averages about 1,157 requests a second.
  4. Plan for the peak. Traffic is not flat, so plan for the busiest hour at about twice that: 2,314 a second.
  5. Then the storage. If 1 request in 10 saves 1 KB, that adds 10 GB a day, about 3.7 TB a year.
  6. Round, then decide. Round freely, even to 100,000 seconds a day: the answer only has to pick the design.
  7. Now you try. How many people use the app each day, in millions? For example: 50 million daily users: about 5,787 requests a second, 11,574 at the busiest hour, and 18.3 TB a year. That needs about 12 servers of 1,000 a second each, behind a load balancer.

Scene 1 of 6: Start from users. Start from what you can guess: say 10,000,000 people use the app each day.

Key points

  1. Start from daily users and requests each, then divide by 86,400 seconds for requests a second.
  2. Plan for the busiest hour, often about 2 times the average, not for the average.
  3. Storage is writes a day times the size of each, then times 365 for a year.
  4. Round boldly: you need the right size to choose the design, not an exact number.

Go deeper in the Capacity estimation lab →

In plain words

Say 10 million people use an app each day, and each makes 10 requests. That is 100 million requests a day, or a little over 1,000 a second. Capacity estimation is this kind of quick sum. It turns a guess about users into requests per second, storage and bandwidth, so you can size the design.

The sums run in a fixed order. Start from users and how often they act, then work out requests a second, data written each day, and storage over the years. Each number answers a design question: one server or many, and whether storage, memory or the network runs out first. Round freely as you go. A rough answer in a few minutes is the goal, not an exact one.

The problem it solves

Without numbers, you size by guesswork. Guess too low and the system falls over under real load. Guess too high and you pay for servers that sit idle. A rough estimate, done in minutes, avoids both.

Why it matters

A design for 1,000 users and a design for 100 million are different systems. A few quick sums tell you which one you are building: one server or hundreds, one database or many. They also show which part runs out first.

A worked example

A service handles 2,000 read requests a second, each returning a 4 KB payload. Outgoing bandwidth is 2,000 × 4 KB, which is 8,000 KB per second, or about 8 MB/s.

Think of it like…

Think of planning a road trip. You know the distance and how far the car goes on a full tank. So you can guess how many fuel stops you need.

Where this analogy stops working

A rough sum from a few known numbers is the useful part. But a trip has one fixed distance. A system's load changes by the hour and grows over the years. So you size for the busiest hour, add spare room, and correct the guess with real measurements.

Try it

See it working

What the results mean

Each result starts from a guess about users, so treat it as a rough size, not an exact answer.

  • QPS (queries per second): how many requests reach the system each second, on average and at the peak.
  • Storage: how much disk the saved data takes over the years you keep it, copies included.
  • Bandwidth: how many bytes cross the network each second.
  • Cache: how much memory holds the most-read data, so fewer reads reach the database.

Change the inputs below, or start from a preset such as a URL shortener or a news feed.

Interview Presets:
100.0 Million users
Actions per active session
90% Read : 10% Write
Typical standard: 2x to 3x
Metadata vs Blob size
1,095 days of data
Each piece of data is stored this many times
Query Per Second (QPS)
57,870 QPS
Peak: 144,675 QPS (2.5x)
Read: 52,083 • Write: 5,787
Network Bandwidth
813.8 Mbps
Ingress: 90.4 Mbps
Egress: 813.8 Mbps
Storage Required (3 Yrs, 3x Replication)
3059.4 TB
Daily: 953.7 GB/day
Monthly: 27.94 TB × 3 copies = 83.82 TB
Redis RAM Cache (80/20)
1716.6 GB RAM
Caches 20% daily read volume
Suggested: ~1728 GB across cluster

Mathematical Derivations & Interview Formulas

1. Traffic & QPS Derivation:
Total Requests/Day = DAU (100,000,000) × Requests/User (50) = 5,000,000,000 req/day
Average QPS = Total Requests / 86,400s ≈ 5,000,000,000 / 86,400 = 57,870 QPS
Peak QPS = Avg QPS × 2.5 = 144,675 QPS
2. Storage Capacity Derivation:
Write Requests/Day = Total (5,000,000,000) × 10% = 500,000,000 writes/day
Daily Data Written = Writes/Day × Payload (2 KB) = 953.7 GB / day
Retention Storage (1095 days with 3x replication) = 953.7 GB × 1095 × 3 = 3059.4 TB
3. Cache Sizing (The Pareto 80/20 Rule):
Daily Read Requests = Total (5,000,000,000) × 90% = 4,500,000,000 reads/day
To satisfy 80% of read traffic, cache 20% of daily unique read items in RAM:
Cache RAM = 20% × 4,500,000,000 × 2 KB = 1716.6 GB RAM

Mechanics

How it works

An estimate turns what you were told into the few numbers a design needs. The pictures carry this page's own numbers through, so you can check each sum by hand.

  1. Traffic math

    Requests per second = daily users × requests per user each day ÷ seconds in a day. A day has 86,400 seconds; round it to 100,000 to make the sum quick. For example, 10 million users × 10 requests ÷ 100,000 is about 1,000 requests a second. Assume the peak is about 2 times the average.

  2. Storage math

    Storage per day = writes per day × size of one write. For example, 1 million posts a day × 1 KB each is 1 GB a day. Multiply by 365 and by the years you keep the data: 5 years is about 1.8 TB.

  3. Bandwidth math

    Bandwidth is how many bytes move each second. Incoming bandwidth = writes per second × size of one write. Outgoing bandwidth = reads per second × size of one read. For example, 1,000 reads a second × 100 KB each is 100 MB a second.

  4. Cache sizing (80/20 rule)

    Pick a case to follow below

    With this case: With no cache, all 1,000 reads a second reached the database.

    App servers, 1,000 reads a secondApp servers1,000 reads a secondCache, in memoryCachein memoryDatabase, on disk, NOWDatabaseon disk1,000 reads/sNOW
    • App servers — 1,000 reads a second — healthy
    • Cache — in memory — healthy
    • Database — on disk — healthy — NOW — 1,000 reads/s
    • Database reads
    Step 1 of 1

    Step 1 of 1 · Database

    Done: All 1,000 reads reach the database

    What happens
    With no cache, every read goes to disk.
    Why
    The database must be sized for every read.
    What changes
    This number decides how big the database must be.
    Next
    The run ends here.

    How it ended. With no cache, all 1,000 reads a second reached the database.

    Reads a second
    1,000
    Answered by the cache
    0
    Reaching the database
    1,000
    Watch: every read
    Cache memory
    0GB

    Step 1 of 1: Database. All 1,000 reads reach the database. With no cache, every read goes to disk.

    Often about 20% of the items get about 80% of the reads. So a common first guess is to 20% of the data read in one day. For example, 20% of 50 GB read each day is 10 GB of memory.

    In the picture, the app makes 1,000 reads a second. With no cache, all of them reach the database. With a 10 GB cache that answers about 80% of reads, only 200 a second reach the database.

    So the cache estimate also changes the database estimate. The 80/20 split is a rule of thumb. Measure the real once the system runs.

  5. Turn the load into servers and cost

    Pick a case to follow below

    With this case: 10,000,000 daily users means a peak of about 2,000 requests a second, 4 servers and about $800 a month.

    Daily users, 10 requests eachDaily users10 requests eachLoad balancer, sees every request, NOWLoad balancersees every request100,000,000 a dayNOWApp servers, 1,000 req/s eachApp servers1,000 req/s each
    • Daily users — 10 requests each — healthy
    • Load balancer — sees every request — healthy — NOW — 100,000,000 a day
    • App servers — 1,000 req/s each — healthy
    • Requests
    Step 1 of 5

    Step 1 of 5 · Load balancer

    Done: 10,000,000 users make 100,000,000 requests a day

    What happens
    Each user makes about 10 requests a day: 10,000,000 × 10.
    Why
    Start from what you were told or agreed: users, and how often each one acts.
    What changes
    Next, turn a day into seconds.
    Next
    About 1,000 requests a second on average
    Requests a day
    100,000,000
    At the peak
    –
    Servers
    –
    Cost a month
    –

    Step 1 of 5: Load balancer. 10,000,000 users make 100,000,000 requests a day. Each user makes about 10 requests a day: 10,000,000 × 10.

    What these pictures simplify. The per-server figure (1,000 requests a second), the price ($200 a month) and the 80% hit rate are examples. Real figures depend on the code, the machine and how reads spread over the items. The capacity lab lets you change every input.

    Divide the peak by what one server can handle, and leave room to spare. Say one app server takes 1,000 requests a second, and you run each at 70%. The peak of 2,000 from step 1 needs 3 servers, plus 1 spare. At an example price of $200 a month each, that is $800 a month. Real servers vary a lot, so measure yours.

    Switch to 30 million users. The same steps give a peak of 6,000 requests a second, 10 servers and about $2,000 a month. Three times the users needs about three times the servers, because each server adds the same capacity.

Use it when

  • Early in a design, after the requirements: the numbers tell you how many servers and how much storage to draw.
  • Before you choose between two designs: a quick sum often shows that the simpler one is enough.

Skip it when

  • A small internal tool with low, steady traffic: one server is plainly enough, so the sums change nothing.
  • Numbers the design does not depend on: skip the bandwidth sum if the system sends only small text.

Check yourself

An app stores 1 million new posts a day, at 1 KB each. About how much is that in a year?

Judgement

Trade-offs and how it fails

What you give up

Cost
A cache sized too large wastes memory you pay for. A cache sized too small misses often, so more reads fall through to the database.
Complexity
Exact sums take time and still rest on guessed inputs. Round numbers are fast, and they are close enough to pick a design. Measure the real system later to correct them.

Failure modes

  • Sizing for the average. Traffic is not flat: the busiest hour can be several times the daily average. This lesson uses 2 times as a first guess.
  • Mixing units: bits with bytes, or a day with a second. Write the unit beside every number.
  • Treating the estimate as exact. The inputs are guesses, so the result is a rough size, not a promise.

In the real world

  • Twitter's engineering blog reported in 2013 that tweets averaged about 5,700 a second, with a record peak of 143,199 a second. That peak was 25 times the average.
  • A ride-hailing example: 5 million drivers each sending a location every 4 seconds is about 1.25 million updates a second.

Trade-offs to be ready to discuss: Memory vs disk

Check yourself

Peak traffic is often several times the daily average. Why size the system for the peak?

Interview

What interviewers look for

  • Round 86,400 seconds a day to 100,000, and say that you are rounding. It keeps the sums quick and easy to follow.
  • Say what each number is for: "About 2,000 requests a second at peak, so two or three app servers."
  • End the estimate with cost: "about N servers, roughly $X a month". Say which part costs the most.

Say it out loud: A service gets 500 million reads a day, and each object is 1 KB. How much memory caches 20% of one day's reads?

An app has 10 million daily users, and each makes 20 requests a day. About how many requests a second is that on average?

Expected depth by interview level

Levels describe the depth interviewers probe, not years of experience. Choose a level on the learning path to highlight it.

JuniorUseful
Rough requests per second and storage from daily users.
MidCore
Estimate load, storage and bandwidth, and use them to justify choices.
SeniorCore
Find the bottleneck from the numbers and size each tier.
StaffCore
Add cost per request and right-size; question over-built designs.

Practice

Apply it

Three harder questions

The first two use the idea on a new case. The last asks you to judge a design.

Apply it

A video app serves 4,000 thumbnail reads a second, at 50 KB each. About how much outgoing bandwidth is that?

Apply it

Peak traffic is 6,000 requests a second. One server handles 1,000 a second, and you run each at no more than 75%. How many servers do you need before adding a spare?

Judge a design

An app reads 200 GB of data each day, and about 20% of items get most of the reads. One engineer wants a 200 GB cache, another a 40 GB one. Which is the better first guess?

Next: how a single request travels between a client and a server.

Go deeper

Sources and further reading

First-hand sources to check this page against and to go further. They are standards, official docs, original papers, and guides from engineering and security teams. Each link was opened on 8 November 2026.