LLM benchmarking interview questions: latency vs throughput
Interview questions on benchmarking LLM inference: TTFT, inter-token latency and throughput, percentiles, goodput, Little's law, load generation, and common benchmarking mistakes, with model answers.
Every optimisation claim in an inference interview should end with "and here is how I measured it". These questions check that you know which metrics matter to users, how load changes them, and how benchmarks mislead.
Question 1
What metrics do you use to benchmark an LLM server?
Model answer
Per request, from the user's point of view:
- Time to first token (TTFT): request sent to first token received. Dominated by queueing and prefill.
- Inter-token latency (ITL) or time per output token (TPOT): the gap between streamed tokens after the first. Dominated by decode step time.
- End-to-end latency: roughly for output tokens.
Per system:
- Throughput: output tokens per second (and requests per second) across all users.
- Goodput: requests per second that meet the SLO on TTFT and ITL. This is the number that matters for capacity planning.
- Cost: tokens per dollar or per GPU hour at the chosen operating point.
Always report percentiles (p50, p90, p99), not just means, and state the prompt and output length distribution, concurrency or request rate, model, precision, hardware and engine version.
Likely follow-up questions
- Why is "tokens per second" ambiguous without more detail?
- What is the difference between TPOT averaged per request and ITL measured per token gap?
- Which metric would a voice assistant care about most? A batch summarisation job?
Question 2
Why do latency and throughput trade off, and how do you show it?
Model answer
More concurrent requests make the batch larger, which raises throughput (decode is memory-bound, so the weight reads are shared), but each step gets a little slower and new requests queue behind admitted ones. So ITL and TTFT rise with load while throughput rises and then flattens.
The right way to show it is a sweep: run the benchmark at increasing request rates (or concurrency levels) and plot throughput against p99 latency, one point per load level. The curve shows a knee where latency starts climbing steeply for little extra throughput. The SLO line on the latency axis picks the operating point, and the throughput at that point is the capacity of one replica.
A single number from one load level hides all of this, and comparing two engines at one arbitrary concurrency can reverse the ranking at another.
Likely follow-up questions
- What causes the knee in the curve?
- Why can an engine with higher peak throughput have lower goodput?
- How would the curve change with speculative decoding turned on?
Question 3
What is Little's law and how do you use it for LLM capacity planning?
Model answer
Little's law says that in a stable system, the average number of requests in the system equals the arrival rate times the average time each spends in it:
For an LLM service: if requests arrive at per second and each takes seconds end to end, about requests are in flight on average. That is the concurrency the fleet must hold, which tells you how much KV cache memory you need (80 times the average context length times bytes per token) and how many replicas, given each replica's maximum concurrency at the SLO.
It also explains why latency explodes near capacity: as utilisation approaches 100 percent, queueing time grows sharply, so plan for headroom (often 60 to 80 percent utilisation) and for bursts.
Likely follow-up questions
- Why does Little's law not tell you the latency distribution?
- How would you size a fleet for a traffic peak three times the average?
- What changes when output lengths have a long tail?
Question 4
What are common mistakes when benchmarking LLM inference?
Model answer
- Unrealistic lengths: fixed short prompts and outputs, or random tokens that hit no prefix cache, when real traffic has long system prompts and varied outputs. Use a sample of real or representative prompts.
- Closed-loop clients only: a fixed number of clients that wait for each response hides queueing. Also run open-loop tests with arrival rates (for example Poisson) to see real TTFT under load.
- No warm-up: the first requests include CUDA graph capture, compilation and cold caches.
- Ignoring output length control: if one engine stops early or ignores end-of-sequence settings, tokens per second is not comparable. Fix the output length or compare at matched lengths.
- Mixing up metrics: averages instead of percentiles, or throughput without the latency it was achieved at.
- Changing several things at once: engine version, quantisation and batch settings together make it impossible to attribute the gain.
- Not checking quality: a faster configuration that changed outputs (quantisation, speculative settings) needs an evaluation alongside.
Likely follow-up questions
- How would you make a benchmark reproducible for a teammate?
- What would you do about run-to-run variance?
- How do you benchmark a prefix-cache optimisation fairly?
Question 5
How would you find out why a deployment is slower than expected?
Model answer
Work from the outside in:
- Compare to the roofline estimate: weight bytes per GPU divided by bandwidth gives the best decode step time. If you are far below it at small batch, suspect overhead; if you are close, the hardware is the limit.
- Split the latency: is TTFT high (queueing, prefill, tokenisation) or ITL high (decode step time, preemption, interference from prefills)?
- Read engine metrics: running and waiting requests, KV cache usage, preemptions, prefix cache hit rate, batch sizes per step.
- Profile: GPU utilisation alone is misleading; use Nsight Systems or the PyTorch profiler to see gaps between kernels (CPU or launch overhead), slow collectives in tensor parallel runs, or a dominant kernel.
- Check configuration: precision actually loaded, attention backend, CUDA graphs enabled, TP degree, maximum sequences and token budget, and the interconnect between GPUs.
Fix the largest gap first, change one thing at a time and re-measure the full sweep.
Likely follow-up questions
- What does a profile with many small gaps between kernels tell you?
- How do you tell preemption from queueing in the metrics?
- What would you check if adding a second GPU with tensor parallelism made things slower?
The lesson behind these answers · 16 min · free
Benchmarking done properly: open loop, percentiles, goodput and honest reporting
Worked numbers, step-through diagrams and a quiz, so you can derive the answer in the interview instead of reciting it.
Read the lesson →- Concurrency, throughput and load testing · Serving & APIs13 min · Pro
- Queueing theory for LLM capacity · Scaling17 min
- Lab: benchmark your rig and compare with theory · Performance Tuning40 min · Pro · lab
- Capstone: from baseline to a measured gain · Benchmarking, Labs and Capstone150 min · Pro · lab
- Prerequisite check, and how to measure from day one · Start Here: The Plan15 min
Articles on this topic
- Cost per million tokens: how to calculate what your LLM really costs to serve (7 min read)
- How many GPUs do you need to serve an LLM? A worked capacity plan (9 min read)
- How to benchmark an LLM server without fooling yourself (7 min read)
- LLM serving metrics explained: TTFT, TPOT, ITL, throughput and goodput (8 min read)
Related interview questions
- Prefill vs decode interview questions (5 questions)
- Batching and continuous batching interview questions (5 questions)
- vLLM, SGLang and llama.cpp internals interview questions (5 questions)