AI Infra Interviews logo

LLM Inference & Serving

35 questions
0 of 35 done · 10 unlocked for you
DONEUNLOCKEDLOCKED

LLM Inference & Serving Interview Questions

Prefill versus decode, the KV cache, PagedAttention and continuous batching, chunked prefill, speculative decoding, disaggregated serving, quantization, vLLM, SGLang and TensorRT-LLM, multi-LoRA and routing: hosting open-weight models at a latency SLO and a cost you can defend.

Learn how AI infrastructure works through explanations, worked examples and diagrams, then practise applying it to interview questions.

Work through the numbers

Change the assumptions in a free calculator, then explain what the result establishes and what still needs measurement.

A starting path through this topic

Start with a mechanism, then use a worked problem to explain a decision. Access labels below describe what is available without an account.

  1. Why do prefill and decode behave so differently, and why does that matter for the hardware you serve on?

    Separate prompt processing from incremental generation when choosing capacity.

    Public answer
You have 10 free answers unlocked here.Sign in free for 10 more · 15 are premium.
01–14Foundationsbuild the vocabulary and basic mechanisms0/14 done
15–27Core loopsapply the ideas to worked interview questions0/13 done
28–35Field scenariosreason through constraints and operational failure scenarios0/8 done
PRACTICE TESTStudied this track? Prove it: a timed LLM Inference & Serving test.rotating questions · every answer explained · free with an accountStart →

The concepts behind LLM Inference & Serving

Review the ideas used in these questions. Each card shows whether the explanation is free, requires sign-in or is part of Premium.

Foundational
Prefill vs DecodeFollow one prompt through its first prediction and later decode steps, then separate GPU work from the wait a user sees. Learn why batch size and context change the likely bottleneck.
Foundational
The KV CacheThe KV cache saves attention keys and values from processed tokens. Follow one decode step, calculate its memory cost, and see why longer conversations reduce the number of requests a GPU can hold.
Core
Sign in
Continuous BatchingContinuous batching changes which requests run between model iterations. Learn how a waiting request joins, why an empty slot is not enough, and how to balance throughput against each user’s token latency.
Advanced
🔒 Premium
PagedAttentionFollow a token position through a block table, watch a cache grow, and trace a shared tail through copy-on-write. Separate memory saved from throughput gained.
Advanced
🔒 Premium
Chunked PrefillFollow a long prompt through a shared token budget, including its final partial chunk. Learn why chunking can reduce stream pauses without guaranteeing a fixed token gap or a universal throughput gain.
Advanced
🔒 Premium
Speculative DecodingA draft proposes tokens; the target checks them with a sampling rule that preserves its distribution. Work through the correction after rejection, count accepted drafts separately from emitted tokens, and decide whether the measured round cost earns a speedup.
Advanced
🔒 Premium
Disaggregated Prefill and DecodeSeparate prefill and decode to control phase interference, then budget the KV handoff. A short isolated transfer can still overload a shared path; cancellation stops generation before it necessarily releases transfer buffers.
Advanced
🔒 Premium
Prefix Caching and KV ReusePrefix caching reuses compatible attention state for leading tokens. Calculate shared memory and token reuse, then weigh cache identity, block ownership and routing delay before expecting a latency gain.
Unlock all 35 answers · ₹2,000 / $25