Interview study sheet · estimation · 3–5 min of the round

Back-of-the-envelope estimation for an LLM system

Turn users into requests, requests into tokens, and tokens into dollars, GPUs, storage and latency. Use round numbers and say every assumption out loud. The interviewer is grading the chain of reasoning and what you decide from it, not whether you land on the exact figure.

▶ Watch the 4:52 explainer

Prefer to read? The study sheet below covers the same ground.

The first principle
In an LLM system, the unit of load and cost is the token, not the request.

Two requests can differ 100x in cost. So every estimate runs through one chain: users → requests → tokens → cost and capacity. Get the token count per request right and everything else is multiplication.

Classic system estimateLLM system estimateWhy it changes
Requests per secondTokens per second (input and output separately)Rate limits and GPU throughput are measured in tokens
Bytes per requestTokens per request, which grows with history and retrievalA chat turn re-sends the whole conversation
Cost per server hourCost per request = tokens × priceCost scales with usage and prompt design, not just traffic
Response time in msTime to first token + output tokens ÷ decode speedLong answers take seconds, so requests stay open
The five steps

Running example: a chat assistant with 1M daily active users. All prices are illustrative.

1

Traffic: users × actions

requests and QPS

Why: everything downstream multiplies off this number, so state it first.

  • 5 conversations/user/day × 4 turns = 20 turns/user/day
  • 1M users × 20 = 20M requests/day
  • 20M ÷ 86,400 s ≈ 230 QPS average
  • peak ≈ 3x average ≈ 700 QPS

"I'll size for peak, about 700 requests per second, because rate limits and capacity bite at peak, not on average."

sizing for the average. Traffic follows time zones and work hours, so a 2–5x peak factor is normal.

2

Tokens per request

input + output

Why: this is the number that decides cost. Break input into its parts so you can pull levers on each.

  • Input ≈ 2,000 tokens: system prompt + conversation history + retrieved documents + the new message.
  • Output ≈ 300 tokens: a typical chat reply.
  • daily input = 20M × 2,000 = 40B tokens
  • daily output = 20M × 300 = 6B tokens

using one turn's size. History is re-sent every turn, so turn 4 carries turns 1–3. Use the average over the whole conversation.

3

Cost: tokens × price

per day, per month, per request

Why: cost per request is the number product and finance care about. Illustrative prices: $1 per 1M input, $5 per 1M output.

  • input: 40,000M × $1/M = $40,000/day
  • output: 6,000M × $5/M = $30,000/day
  • total ≈ $70K/day ≈ $2.1M/month
  • $70K ÷ 20M turns ≈ $0.0035 per turn

"About a third of a cent per turn, two million a month. Input is 87% of the tokens and the larger share of cost, so caching and shorter context are my first levers."

assuming input dominates cost because it dominates volume. Output costs 5x more per token here, so it is still 43% of the bill.

4

Capacity: tokens per second at peak

rate limits or GPUs

Why: the provider limits you in tokens per minute, and self-hosted GPUs are sized in tokens per second.

  • output: 700 QPS × 300 = 210K tokens/s ≈ 12.6M tokens/min
  • input: 700 QPS × 2,000 = 1.4M tokens/s ≈ 84M tokens/min
  • self-hosted: if one replica sustains ~2,500 output tokens/s at your latency target, 210K ÷ 2,500 ≈ 85 replicas, plus headroom

"Eighty-four million input tokens a minute at peak is beyond a default API tier, so I'd plan for a negotiated limit, several regions, or self-hosting part of the traffic."

checking only output tokens. Input-token limits are usually hit first because input is 7x larger.

5

Storage and latency

the two people forget

Why: logs grow fast, and long outputs keep connections open.

  • logs: 20M turns × ~10 KB = 200 GB/day ≈ 6 TB/month
  • embeddings: 10M chunks × 1,024 dims × 4 B ≈ 41 GB
  • latency: 300 tokens ÷ 50 tokens/s ≈ 6 s to finish, so stream it
  • open streams: 700 QPS × 6 s ≈ 4,200 at once (Little's law)

"Two hundred gigabytes of logs a day means I'd set a retention window and sample full traces rather than keep everything."

quoting total latency only. Budget time to first token (network + retrieval + prefill) separately from decode time.

Where it goes

Tokens versus dollars

Token volume per day (46B)

Cost per day ($70K)

Input 40B · $40K
Output 6B · $30K
The whole chain

One calculation to draw on the board

1M users × 20 turns          = 20M requests/day
20M ÷ 86,400                 ≈ 230 QPS  → peak ×3 ≈ 700 QPS
× 2,000 in + 300 out tokens  = 40B in + 6B out per day
× $1/M in, $5/M out          = $40K + $30K = $70K/day ≈ $2.1M/month
÷ 20M                        ≈ $0.0035 per turn
700 QPS × 300 out            = 210K output tokens/s at peak
20M × 10 KB logs             = 200 GB/day
Numbers → decisions

What the estimate tells you to build

The number saysSo you decideRough effect
Input is 87% of tokensPrompt caching for the system prompt and history, trim history, retrieve fewer chunksinput bill down 30–60%
Most turns are easyRoute 60% of turns to a model 10x cheaper0.4 + 0.6 × 0.1 = 46% of cost
84M input tokens/min at peakNegotiate limits, spread across regions, or self-host part of the loadavoid 429s at peak
6 s to finish an answerStream tokens, cap output length, keep about 4,200 connections openfirst token < 1 s
200 GB of logs a dayRetention window, sample full traces, keep metrics for everything6 TB/mo → far less

Routing check: 60% of turns at a tenth of the price leaves 40% + 6% = 46% of the bill, about $32K a day instead of $70K. That is "more than half" saved.

What interviewers score
  • Assumptions stated: "I'll assume 20 turns per user per day."
  • Round numbers: 86,400 is about 100K when you need speed.
  • Peak, not average: sized where limits apply.
  • Input and output kept apart: they differ in price and size.
  • A decision from every number: math that doesn't change the design is wasted time.
Common mistakes
  • Forgetting that history makes input grow every turn.
  • Ignoring peak versus average.
  • One blended token price instead of input and output.
  • Skipping storage and latency entirely.
  • Chasing precision. Being within 2x is fine.
Memorise this

The 30-second answer

"In an LLM system the unit of cost is the token, so I run one chain. Users times actions gives requests per day: a million users at 20 turns is 20 million, about 230 QPS on average and 700 at peak. Times tokens per request, counting history and retrieved context on the input side: 2,000 in and 300 out gives 40 billion input and 6 billion output tokens a day. Times price: about $70K a day, roughly a third of a cent per turn. Then capacity at peak: 210K output tokens per second, so I check rate limits or GPU count. I add storage, about 200 GB of logs a day, and a latency budget. Then I say what the numbers mean: cache and trim the input, and route easy turns to a cheaper model."

The video is narrated by an AI voice and was scripted with AI assistance. Watch it on YouTube.