Question bank
Interview Questions — Inference Engineering
80 questionsWhat the provenance labels mean
In this bank
Round: GenAI/LLM depth (required) · GenAI system design (required) · ML-systems and infrastructure follow-ups Provenance: every section below is labelled Common industry pattern (topics that recur in LLM-serving discussions) or Generated practice. None is verified as asked by a named company. Numbers are illustrative unless a source is named; hardware and engine details change quickly, so check current documentation before quoting versions or features. Priority: ★★★ expect it · ★★ common · ★ a differentiator for senior or infrastructure roles. These stars are our judgment, not data. How to use: answer aloud for 60 to 90 seconds, then compare with the key points. The lessons are in the Inference engineering module, and the drills are in Inference engineering: interview drills Open the course to learn this.
A. Request lifecycle, metrics and the roofline
Provenance: Common industry pattern. Teaching: Request lifecycle, metrics and the roofline Open the course to learn this
| # | Priority | Question | Key points | Follow-up |
|---|---|---|---|---|
| A1 | ★★★ | Prefill versus decode?Label: Common industry pattern | Prefill processes the whole prompt in parallel, builds the KV-cache and sets TTFT. Decode makes one token per step, rereads weights and cache, and sets inter-token latency. | Why do they need different optimizations? |
| A2 | ★★★ | Why is decode memory-bound?Label: Common industry pattern | Intensity is about 2B ÷ bytes per weight (B for BF16), far under a ridge of a few hundred; weights are read each step for a few operations each. | What batch reaches the ridge on an H100? |
| A3 | ★★★ | Define TTFT, ITL, throughput and goodput.Label: Common industry pattern | TTFT is queue plus prefill; ITL = (end-to-end − TTFT) ÷ (tokens − 1); throughput is tokens per second across users; goodput counts requests that meet the targets. | Which go into an SLO? |
| A4 | ★★★ | Upper bound on decode speed for an N-billion-parameter model?Label: Common industry pattern | Weight bytes ÷ (bandwidth × GPUs); add the cache read for a tighter bound. | What changes with 4-bit weights? |
| A5 | ★★ | FLOPs per token of inference?Label: Common industry pattern | About 2P for a dense model, plus attention that grows with context. | Why does prefill FLOPs scale with prompt length? |
| A6 | ★★ | Why does batching raise throughput?Label: Common industry pattern | One weight read serves the whole batch while arithmetic was idle. | What limits batch size? |
| A7 | ★★ | Explain the roofline model.Label: Common industry pattern | Attainable speed is the lower of peak compute and bandwidth × intensity; the ridge is peak FLOP/s ÷ bandwidth. | Where do prefill and decode sit? |
| A8 | ★★ | Is prefill always compute-bound?Label: Common industry pattern | No: its intensity is about the prompt length, so a short prompt can sit below the ridge. | How would you check? |
| A9 | ★★ | Why must you quote throughput with latency?Label: Common industry pattern | Bigger batches raise throughput and can lengthen each wait; the token type and load also matter. | How do you say it in an SLO? |
| A10 | ★ | Where does time go besides matrix multiplies?Label: Common industry pattern | Launch overhead, sampling, CPU scheduling, communication, framework overhead. | How do you find out? |
| A11 | ★ | Which datasheet number do you use for the ridge?Label: Common industry pattern | The dense figure; many listed peaks are “with sparsity”, about twice dense. | Why does the exact part number matter? |
B. Memory and the KV-cache
Provenance: Common industry pattern. Teaching: Memory and the KV-cache Open the course to learn this
| # | Priority | Question | Key points | Follow-up |
|---|---|---|---|---|
| B1 | ★★★ | What is the KV-cache and how big is it?Label: Common industry pattern | Keys and values of past tokens: 2 × layers × KV heads × head dim × bytes per token, times tokens and sequences. | Compute it for a given configuration. |
| B2 | ★★★ | What is PagedAttention?Label: Common industry pattern | Fixed blocks and a block table per sequence; on-demand allocation removes fragmentation, enables sharing and larger batches. | Does it make attention faster? |
| B3 | ★★★ | Prefix caching versus response caching?Label: Common industry pattern | Reuse of prefill for an identical leading prefix versus returning a stored answer. | What breaks prefix caching? |
| B4 | ★★ | How do GQA, MQA and MLA help serving?Label: Common industry pattern | Fewer KV heads or a compressed latent mean a smaller cache, more concurrency and less decode traffic. | Why is it a pretraining decision? |
| B5 | ★★ | How many requests fit on a GPU?Label: Common industry pattern | (Memory × utilization − weights − overhead) ÷ (bytes per token × tokens per request). | What if long-context users arrive? |
| B6 | ★★ | What happens when the cache fills?Label: Common industry pattern | Queue, preempt (recompute or swap), or shed; preemption storms collapse goodput. | How do you mitigate? |
| B7 | ★★ | Fits versus serves?Label: Common industry pattern | Weights can fit and leave no memory for cache or overhead. | How do you fix it? |
| B8 | ★★ | How does the cache limit speed as well as count?Label: Common industry pattern | Each step reads every sequence’s cache, so at large batch and context the caches can outweigh the weights. | What is the effect on the batch-1 ceiling? |
| B9 | ★ | KV-cache quantization?Label: Common industry pattern | Eight bits roughly doubles capacity; accuracy risk grows with context, so validate by length. | How do you gate it? |
| B10 | ★ | Long-context cost?Label: Common industry pattern | Cache grows linearly, prefill attention superlinearly, and each decode step reads more. | What are the alternatives? |
| B11 | ★ | Tenant isolation for prefix caches?Label: Common industry pattern | A cache salt or per-tenant scoping, since shared caches can leak information about other prompts. | What do you give up? |
C. Kernels, quantization and numerics
Provenance: Common industry pattern. Teaching: Model and kernel optimization Open the course to learn this
| # | Priority | Question | Key points | Follow-up |
|---|---|---|---|---|
| C1 | ★★★ | What is quantization and what does it trade?Label: Common industry pattern | Fewer bits for weights, activations or cache: less memory and bandwidth, possible speed; quality loss, calibration and hardware support. | How do you validate? |
| C2 | ★★★ | FlashAttention?Label: Common industry pattern | Exact, tiled attention with an online softmax; fewer HBM accesses; helps prefill most. | Why not an approximation? |
| C3 | ★★ | Weight-only 4-bit versus FP8 W8A8?Label: Common industry pattern | Memory-bound work favours weight-only; compute-bound favours 8-bit math; depends on batch and hardware. | Which hardware supports FP8? |
| C4 | ★★ | GPTQ, AWQ, SmoothQuant?Label: Common industry pattern | Second-order rounding compensation; protecting salient channels chosen by activations; moving activation outliers into weights. | Which is W8A8? |
| C5 | ★★ | Why do activation outliers matter?Label: Common industry pattern | One large value sets a per-tensor scale and rounds small values to zero. | Name two remedies. |
| C6 | ★★ | CUDA graphs?Label: Common industry pattern | Record a kernel sequence and replay it with one launch; padded to captured sizes. | What is the cold-start cost? |
| C7 | ★★ | Why is temperature 0 not deterministic?Label: Common industry pattern | Floating-point addition is not associative and kernels change reduction order with batch size. | How would you get reproducibility? |
| C8 | ★★ | After 4-bit, accuracy is flat but JSON failures double.Label: Common industry pattern | Task-level regression hidden by an average: evaluate structured output, slice, raise precision for sensitive layers. | What gate would you add? |
| C9 | ★ | Distillation, quantization and routing: order for cost?Label: Common industry pattern | Different cost and quality profiles; combine, validating each step. | What do you try first and why? |
| C10 | ★ | Why is sparsity rarely used?Label: Common industry pattern | Needs hardware support and recovery tuning; listed “with sparsity” peaks assume it. | When would it pay? |
D. Scheduling and decoding
Provenance: Common industry pattern. Teaching: Scheduling and decoding Open the course to learn this
| # | Priority | Question | Key points | Follow-up |
|---|---|---|---|---|
| D1 | ★★★ | Continuous batching?Label: Common industry pattern | Iteration-level scheduling: finished sequences leave and waiting ones join at every step. | What is the downside? |
| D2 | ★★★ | Speculative decoding?Label: Common industry pattern | A draft proposes γ tokens; the target verifies them in one pass; accept or resample preserves the distribution. | Speedup formula? When does it fail? |
| D3 | ★★ | Chunked prefill?Label: Common industry pattern | A token budget per step mixes prefill chunks with decodes, protecting ITL. | What does the budget trade? |
| D4 | ★★ | Prefill and decode disaggregation?Label: Common industry pattern | Separate pools with a KV transfer; independent tuning and scaling. | When is it not worth it? |
| D5 | ★★ | Constrained decoding at the engine level?Label: Common industry pattern | A grammar state machine masks disallowed tokens before sampling. | Valid versus correct? |
| D6 | ★★ | Little’s law for capacity?Label: Common industry pattern | In flight = arrival rate × time; sustainable rate = concurrency ÷ time per request. | What do you do beyond it? |
| D7 | ★★ | Admission control and load shedding?Label: Common industry pattern | Reject early with a retry hint rather than serve everyone late; priorities and quotas. | How does it help goodput? |
| D8 | ★★ | Streaming and cancellation?Label: Common industry pattern | Streaming improves perceived latency; cancelling on disconnect frees cache and slots. | What about slow consumers? |
| D9 | ★ | Draft sources for speculation?Label: Common industry pattern | Small model, Medusa heads, EAGLE, multi-token prediction, n-gram or prompt lookup. | Which fits summarization? |
| D10 | ★ | Impact of reasoning models on serving?Label: Common industry pattern | Long hidden outputs make cost decode-dominated; budget, cap or route. | Billing implications? |
E. Parallelism, engines and hardware
Provenance: Common industry pattern. Teaching: Distributed serving, engines and hardware Open the course to learn this
| # | Priority | Question | Key points | Follow-up |
|---|---|---|---|---|
| E1 | ★★★ | TP versus PP versus DP versus EP?Label: Common industry pattern | What is split and what is communicated; smallest degree that fits, then replicas. | Why TP within a node? |
| E2 | ★★★ | vLLM, SGLang and TensorRT-LLM?Label: Common industry pattern | Flexibility and ecosystem; KV reuse and programs; NVIDIA-only performance; choose on your traffic and check status. | How would you choose? |
| E3 | ★★ | How do you serve a mixture-of-experts model?Label: Common industry pattern | Memory by total parameters, compute by active; expert parallelism with all-to-all; imbalance. | Why p99 spikes? |
| E4 | ★★ | Self-host or API?Label: Common industry pattern | Utilization-dependent cost, control, privacy, operations, quality; hybrid. | Compute the break-even. |
| E5 | ★★ | Multi-LoRA serving?Label: Common industry pattern | One resident base, small adapters, batching across adapters, per-adapter caches. | Versus separate full models? |
| E6 | ★★ | A 400B dense model on 8-GPU nodes?Label: Common industry pattern | Weights, cache and step-floor arithmetic; 8-bit weights or larger-memory GPUs; TP in node. | What if the interconnect is slow? |
| E7 | ★ | Hardware selection?Label: Common industry pattern | Capacity for fit, bandwidth for decode, compute for prefill, interconnect for scaling, price. | How do you compare across vendors? |
| E8 | ★ | Serving embedding and reranker models?Label: Common industry pattern | Encoder batches are compute-bound with no decode loop; separate pools. | Latency budget in RAG? |
F. Production operations
Provenance: Common industry pattern. Teaching: Production operations: capacity, scaling and failure Open the course to learn this
| # | Priority | Question | Key points | Follow-up |
|---|---|---|---|---|
| F1 | ★★★ | What do you autoscale on?Label: Common industry pattern | Queue depth, KV utilization, TTFT or tokens per second against capacity; not CPU or GPU utilization alone. | How do you handle cold start? |
| F2 | ★★★ | How do you benchmark an LLM server?Label: Common industry pattern | Realistic lengths, open-loop arrivals, percentiles, goodput at the target, warm-up, cache control. | Closed versus open loop? |
| F3 | ★★ | Capacity planning?Label: Common industry pattern | Peak ÷ per-replica goodput ÷ utilization target, plus spares; cross-check with Little’s law and the cache. | Show a worked example. |
| F4 | ★★ | Routing strategies?Label: Common industry pattern | Least loaded, prefix-aware, session and adapter affinity, priority tiers. | Affinity versus balance? |
| F5 | ★★ | Failure modes and mitigations?Label: Common industry pattern | Out-of-memory, preemption storms, GPU hangs, zombie requests, herds, bad rollouts. | Design a health check. |
| F6 | ★★ | A safe rollout of a new model or quantization?Label: Common industry pattern | Offline evaluation, shadow, canary, automatic rollback, quality and performance metrics. | What do you watch? |
| F7 | ★★ | Which alerts page someone?Label: Common industry pattern | Symptoms (TTFT, ITL, errors, goodput); causes go on dashboards. | Give an example of each. |
| F8 | ★ | Multi-tenant isolation?Label: Common industry pattern | Quotas, fair scheduling, tenant-scoped caches, redacted logs. | Prefix-cache side channels? |
| F9 | ★ | Retries and hedging?Label: Common industry pattern | Retry only idempotent, pre-first-token failures with jitter and deadlines; hedging doubles load. | When would you hedge? |
| F10 | ★ | A cost-reduction plan?Label: Common industry pattern | Utilization, caching, validated quantization, routing, off-peak capacity for batch, output control; state each cost. | What first and why? |
G. Scenarios (diagnose aloud)
Provenance: Generated practice.
| # | Priority | Scenario | Key points |
|---|---|---|---|
| G1 | ★★★ | At peak, the first word takes forever, then streaming is fine.Label: Generated practice | TTFT: queueing, long prompts, prefix misses, capacity; measure its parts, then prefix caching, chunked prefill or replicas. |
| G2 | ★★★ | Streaming stutters whenever someone pastes a huge document.Label: Generated practice | Prefill interference: chunked prefill and token budget, input caps, isolation. |
| G3 | ★★ | A 70B model runs out of memory on 32k-token requests.Label: Generated practice | Cache arithmetic; cap and tier context; 8-bit cache; a long-context pool; retrieval instead of stuffing. |
| G4 | ★★ | Throughput is fine and p99 is awful.Label: Generated practice | Queueing, preemption, imbalance, a long tail of requests; admission control. |
| G5 | ★★ | Cost per token doubled after a small prompt change.Label: Generated practice | Prefix cache invalidated, longer outputs, lower utilization. |
| G6 | ★★ | GPU utilization is 90 percent but throughput fell.Label: Generated practice | Preemption and recompute with a full cache; check the preemption count and cache use. |
| G7 | ★★ | The benchmark showed good p95 TTFT; production is four times worse.Label: Generated practice | Fixed short prompts, closed loop, hot cache; replay real traces open loop. |
| G8 | ★ | Choose between buying GPUs and an API for 3 times the traffic.Label: Generated practice | Utilization, commitments, lead times, a hybrid. |
H. Whiteboard problems
Provenance: Generated practice. Keys use the formulas in the lessons.
| # | Priority | Problem | Key |
|---|---|---|---|
| H1 | ★★★ | KV bytes per token for 60 layers, 8 KV heads, head dimension 128, 8-bit values.Label: Generated practice | 2 × 60 × 8 × 128 × 1 = 122,880 bytes, about 120 KiB. |
| H2 | ★★★ | Batch-1 decode bound for a 34B model in 8-bit on a GPU with 2 TB/s.Label: Generated practice | 34 GB ÷ 2 TB/s = 17 ms, at most about 59 tokens per second. |
| H3 | ★★ | Speculative speedup for α = 0.7, γ = 4, c = 0.1.Label: Generated practice | (1 − 0.7⁵) ÷ 0.3 = 2.77 tokens per step; ÷ 1.4 gives about 1.98. |
| H4 | ★★ | Cost per million tokens: 3 dollars per hour, 1,800 tokens per second at full load, 60 percent utilization.Label: Generated practice | 1,080 tokens per second: 3 ÷ (1,080 × 3,600) × 10⁶ = about 0.77 dollars. |
| H5 | ★★ | Replicas for 25 requests per second at 200 output tokens, 1,800 tokens per second per replica, 0.7 utilization, one spare.Label: Generated practice | 5,000 ÷ (1,800 × 0.7) = 3.97, so 4 plus 1 spare is 5. Check with Little’s law. |
I. System design prompts
Provenance: Generated practice. Teaching: Inference engineering: interview drills Open the course to learn this
| # | Priority | Prompt | Key points |
|---|---|---|---|
| I1 | ★★★ | Design a shared LLM inference platform for chat, document Q&A and a nightly batch job.Label: Generated practice | Seven parts: clarify, estimate, stack, architecture, evaluation and rollout, failure modes, cost. |
| I2 | ★★★ | Plan serving for a model twice the size of your current one, with no measurements.Label: Generated practice | Weights and cache arithmetic, layout, quantization gate, re-benchmark, cold start, what to measure first. |
| I3 | ★★ | Design autoscaling for traffic that doubles at 9 a.m. each Monday.Label: Generated practice | Scheduled scale-up, warm pool, queue and cache signals, load shedding in the gap. |
| I4 | ★★ | Design a serving tier for a fine-tuned model per customer.Label: Generated practice | One base, adapters, adapter-aware routing, per-adapter caches, quotas. |
| I5 | ★ | Design a hybrid of self-hosted and API serving.Label: Generated practice | Route steady volume to your fleet, spikes and the long tail to the API; residency limits; the same prompt contract. |
J. Project and behavioural angle
Provenance: Generated practice. See also Projects and behavioural questions.
| # | Priority | Question | Key points |
|---|---|---|---|
| J1 | ★★ | Tell me about a time you found a serving bottleneck and fixed it.Label: Generated practice | Use a real case: the prediction, the measurement, one change, the result. Never invent figures. |
| J2 | ★ | How do you decide which optimization to try first?Label: Generated practice | Compute the ceiling, find the phase and the limit (bytes, compute, cache, overhead), pick the cheapest lever that attacks it, state its price. |
Common candidate mistakes
- Mixing up the KV-cache with a response or semantic cache.
- Calling decode compute-bound.
- Using attention heads instead of KV heads for cache size.
- Treating quantization as free, or perplexity as proof.
- Believing a bigger batch lowers latency.
- Autoscaling on CPU or GPU utilization; benchmarking with fixed lengths in a closed loop.
- Giving no numbers or assumptions.
Study order (suggested)
- The ★★★ items in sections A to F: answer aloud, then compare.
- The whiteboard problems H1 to H5, then scenarios G1 to G3.
- One design prompt from I, timed, with a friend changing a constraint halfway.
- The ★★ items for the part of the stack your next interview targets.
Pair with Advanced, Scenario Based and the Top 100 priority questions.