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

#PriorityQuestionKey pointsFollow-up
A1★★★Prefill versus decode?Label: Common industry patternPrefill 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 patternIntensity 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 patternTTFT 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 patternWeight 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 patternAbout 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 patternOne weight read serves the whole batch while arithmetic was idle.What limits batch size?
A7★★Explain the roofline model.Label: Common industry patternAttainable 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 patternNo: 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 patternBigger 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 patternLaunch 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 patternThe 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

#PriorityQuestionKey pointsFollow-up
B1★★★What is the KV-cache and how big is it?Label: Common industry patternKeys 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 patternFixed 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 patternReuse 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 patternFewer 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 patternQueue, preempt (recompute or swap), or shed; preemption storms collapse goodput.How do you mitigate?
B7★★Fits versus serves?Label: Common industry patternWeights 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 patternEach 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 patternEight 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 patternCache grows linearly, prefill attention superlinearly, and each decode step reads more.What are the alternatives?
B11★Tenant isolation for prefix caches?Label: Common industry patternA 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

#PriorityQuestionKey pointsFollow-up
C1★★★What is quantization and what does it trade?Label: Common industry patternFewer 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 patternExact, 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 patternMemory-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 patternSecond-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 patternOne large value sets a per-tensor scale and rounds small values to zero.Name two remedies.
C6★★CUDA graphs?Label: Common industry patternRecord 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 patternFloating-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 patternTask-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 patternDifferent cost and quality profiles; combine, validating each step.What do you try first and why?
C10★Why is sparsity rarely used?Label: Common industry patternNeeds 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

#PriorityQuestionKey pointsFollow-up
D1★★★Continuous batching?Label: Common industry patternIteration-level scheduling: finished sequences leave and waiting ones join at every step.What is the downside?
D2★★★Speculative decoding?Label: Common industry patternA 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 patternA token budget per step mixes prefill chunks with decodes, protecting ITL.What does the budget trade?
D4★★Prefill and decode disaggregation?Label: Common industry patternSeparate 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 patternA grammar state machine masks disallowed tokens before sampling.Valid versus correct?
D6★★Little’s law for capacity?Label: Common industry patternIn 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 patternReject 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 patternStreaming improves perceived latency; cancelling on disconnect frees cache and slots.What about slow consumers?
D9★Draft sources for speculation?Label: Common industry patternSmall 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 patternLong 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

#PriorityQuestionKey pointsFollow-up
E1★★★TP versus PP versus DP versus EP?Label: Common industry patternWhat 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 patternFlexibility 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 patternMemory by total parameters, compute by active; expert parallelism with all-to-all; imbalance.Why p99 spikes?
E4★★Self-host or API?Label: Common industry patternUtilization-dependent cost, control, privacy, operations, quality; hybrid.Compute the break-even.
E5★★Multi-LoRA serving?Label: Common industry patternOne 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 patternWeights, 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 patternCapacity 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 patternEncoder 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

#PriorityQuestionKey pointsFollow-up
F1★★★What do you autoscale on?Label: Common industry patternQueue 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 patternRealistic lengths, open-loop arrivals, percentiles, goodput at the target, warm-up, cache control.Closed versus open loop?
F3★★Capacity planning?Label: Common industry patternPeak ÷ 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 patternLeast loaded, prefix-aware, session and adapter affinity, priority tiers.Affinity versus balance?
F5★★Failure modes and mitigations?Label: Common industry patternOut-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 patternOffline evaluation, shadow, canary, automatic rollback, quality and performance metrics.What do you watch?
F7★★Which alerts page someone?Label: Common industry patternSymptoms (TTFT, ITL, errors, goodput); causes go on dashboards.Give an example of each.
F8★Multi-tenant isolation?Label: Common industry patternQuotas, fair scheduling, tenant-scoped caches, redacted logs.Prefix-cache side channels?
F9★Retries and hedging?Label: Common industry patternRetry 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 patternUtilization, 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.

#PriorityScenarioKey points
G1★★★At peak, the first word takes forever, then streaming is fine.Label: Generated practiceTTFT: 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 practicePrefill interference: chunked prefill and token budget, input caps, isolation.
G3★★A 70B model runs out of memory on 32k-token requests.Label: Generated practiceCache 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 practiceQueueing, preemption, imbalance, a long tail of requests; admission control.
G5★★Cost per token doubled after a small prompt change.Label: Generated practicePrefix cache invalidated, longer outputs, lower utilization.
G6★★GPU utilization is 90 percent but throughput fell.Label: Generated practicePreemption 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 practiceFixed 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 practiceUtilization, commitments, lead times, a hybrid.

H. Whiteboard problems

Provenance: Generated practice. Keys use the formulas in the lessons.

#PriorityProblemKey
H1★★★KV bytes per token for 60 layers, 8 KV heads, head dimension 128, 8-bit values.Label: Generated practice2 × 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 practice34 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 practice1,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 practice5,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

#PriorityPromptKey points
I1★★★Design a shared LLM inference platform for chat, document Q&A and a nightly batch job.Label: Generated practiceSeven 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 practiceWeights 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 practiceScheduled 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 practiceOne base, adapters, adapter-aware routing, per-adapter caches, quotas.
I5★Design a hybrid of self-hosted and API serving.Label: Generated practiceRoute 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.

#PriorityQuestionKey points
J1★★Tell me about a time you found a serving bottleneck and fixed it.Label: Generated practiceUse 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 practiceCompute 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)

  1. The ★★★ items in sections A to F: answer aloud, then compare.
  2. The whiteboard problems H1 to H5, then scenarios G1 to G3.
  3. One design prompt from I, timed, with a friend changing a constraint halfway.
  4. The ★★ items for the part of the stack your next interview targets.

Pair with Advanced, Scenario Based and the Top 100 priority questions.