LLMModule 09 · Interview prep

LLM inference engineering: 25 interview problems, worked through with real numbers

How a model actually gets served: from one request to a million users. Ten pages cover all 25 problems, each with the concepts, a worked answer with real arithmetic, trade-offs, a model interview answer and an interactive demo.

Source: Vishal Singh, X post, 24 Oct 2026 · saved in sources/09-vishal-inference-25.md

Start here (no maths needed)

Training makes a model smart. Inference is using it, for lots of people, fast and cheaply. That's a big engineering job of its own.

Think of it like this

Think of a busy restaurant kitchen. The recipe (the model) is already written. Now the kitchen must cook it for hundreds of diners at once. The chef keeps ingredients ready on the counter (the memory cache), cooks several orders on one stove (batching), starts serving the first bite fast so nobody waits too long, and keeps the gas bill down (cost). Inference engineers run that kitchen.

How it works

  1. A question arrives and joins a queue.
  2. The model reads the whole question in one go (this is called "prefill").
  3. Then it writes the answer one word-piece at a time, sending each as it goes (this is called "decode").
  4. To avoid re-reading everything for every new word, it keeps a memory of what it has read (the KV cache).
  5. The server juggles many people's requests on the same chips so none are left idle.

Why robots care

A robot's brain has the same steps, but on a small computer inside the robot with a hard time limit. If it takes too long to think, the robot keeps moving in the meantime. Module 04's "how far does the robot travel after you say stop" calculator shows why.

Try it

Next time you're in a queue at a café, notice: does the barista make one drink at a time, or start several at once? Which way gets everyone served sooner? That's the batching question in Problems 6 and 7.

Words to know

Inference
Running a trained model to get answers.
Token
A word-piece the model reads or writes.
Latency
How long you wait.
Throughput
How much work gets done per second, across everyone.
GPU
The chip that does the model's maths.

Going deeper: the rest of this page is the map of all 25 problems. The author's advice applies: don't memorise answers. Understand the concepts, work through real numbers and focus on the trade-offs.

Progress

Pages done
0 / 10
Next up

The 10 pages (25 problems)

01

1 · From request to first token. 2 · Streaming over SSE, disconnects and cancellation.

02

3 · Size the KV cache for a 70B model at 32K × 100 users. 4 · PagedAttention. 5 · Why FlashAttention is faster with the same maths.

03

6 · Continuous vs static batching. 7 · Chunked prefill for a 100K-token prompt. 21 · Multi-tenant fairness and admission control.

04

8 · Prefix caching and cache-aware routing. 22 · Splitting prefill and decode, and moving the KV cache.

05

9 · Cut inter-token latency without losing throughput. 10 · When speculative decoding helps or hurts. 17 · p99 is 10× p50.

06

11 · FP8 vs INT8 vs INT4 vs NVFP4. 12 · H100 vs H200 vs B200 vs L40S.

07

13 · Profile with Nsight. 14 · GPU at 30% utilisation. 15 · A fused Triton RMSNorm.

08

16 · TTFT, TPOT, queue depth, cache hit rate, cost per request. 18 · Benchmarking vLLM vs TensorRT-LLM vs SGLang.

09

19 · Rolling out a new model or quantisation with rollback. 20 · Autoscaling with slow cold starts.

10

23 · Serving a large MoE: tensor, pipeline and expert parallelism. 24 · Cut cost per million tokens by 70%. 25 · ChatGPT-style serving for 1M daily users.

A 24-hour prep plan

HoursPagesGoal
0–401, 02Explain prefill vs decode, and size a KV cache on paper without notes.
4–803, 04Explain why continuous batching wins, and sketch prefix caching and disaggregation.
8–1205, 06Do the speculative-decoding and bandwidth-bound arithmetic. Pick a GPU and a precision, and justify both.
12–1607, 08Explain the roofline, debug "30% utilisation", and name the dashboards you'd build.
16–2009, 10Operations, MoE parallelism, and the cost-reduction levers.
20–2410 (Problem 25)Do the 1M-user capstone out loud, twice, with different assumptions.

Where this course already covers it