AIInterviewTraining logoAIInterview/Training

serving

AI, ML & GenAI interview questions tagged serving, across every topic.

33 questions · 4 unlocked for you

Concepts behind "serving"

The curriculum that explains the ideas these questions test.

Foundational
⚙️ System Design for AI in Production
Latency Budgets and StreamingLLM latency is not a single figure: time-to-first-token (driven by prefill and queueing) and inter-token latency (driven by decode) feel very different to users. Streaming tokens as they generate masks total latency by showing progress right away. Designing to a latency budget means splitting time across retrieval, model, and tools, tracking TTFT and tokens-per-second (not only end-to-end), and applying streaming, caching, and routing to meet it. AI, ML, and GenAI engineer interviews probe it because perceived latency makes or breaks LLM UX.
Foundational
🖥️ ML Infrastructure & Serving
GPU Memory and the Serving StackServing an LLM is largely a memory problem: the GPU has to hold the model weights along with a KV cache that scales with sequence length and batch size, and inference divides into a compute-bound prefill and a memory-bandwidth-bound decode. Understanding the memory math (weights plus KV cache), why decode is bandwidth-bound, and the levers (quantization, batching, paged attention) is the bedrock of LLM serving. AI, ML, and GenAI engineer interviews probe it because 'will this model fit and how fast will it run?' is a recurring production question.
Core
🧠 Foundations of LLMs & GenAISign in
Attention Variants: MHA, MQA, and GQAMulti-head attention gives every query head its own key and value heads, which is expressive but leaves the KV cache large and memory-bandwidth hungry at decode time. Multi-query attention shares one key-value head across all query heads to shrink the cache sharply, and grouped-query attention sits between them by sharing key-value heads across small groups. AI, ML, and GenAI engineer interviews probe this because it is the cleanest example of trading model quality against serving memory and throughput, and it explains why frontier models standardized on GQA.
Core
🧠 Foundations of LLMs & GenAISign in
The KV CacheIn autoregressive decoding a model would recompute attention over the whole history at every step; the KV cache keeps each token's key and value vectors so a new token only attends and never recomputes. Compute is saved, but the cost shifts to memory: the cache grows with sequence length times batch size and usually turns into the binding constraint in serving. AI, ML, and GenAI interviews probe it because it explains why long contexts are costly to serve, why throughput (not model speed) is often the limit, and why MQA/GQA and PagedAttention exist.
Core
🖥️ ML Infrastructure & ServingSign in
Continuous BatchingGPUs run efficiently on batches, but LLM requests show up at different times and complete after different numbers of tokens, so static batching wastes the GPU while it waits on the slowest request. Continuous (in-flight) batching inserts and evicts requests from the running batch at each decoding step, holding the GPU full and sharply lifting throughput. AI, ML, and GenAI engineer interviews probe it because it is the single biggest throughput lever in LLM serving and explains why one replica can serve many concurrent users.
Advanced
🖥️ ML Infrastructure & Serving🔒 Premium
Disaggregated Prefill/Decode and Prefix CachingLLM inference has two phases with opposite hardware profiles: prefill is compute-bound (it works through the whole prompt in parallel) while decode is memory-bandwidth bound (one token at a time). Running both on the same GPU pool makes them compete, so long prefills stall ongoing decodes and you miss either the time-to-first-token or the time-per-output-token SLO. Disaggregation places them on separate GPU pools and moves the KV cache between them, and prefix caching reuses KV for shared prompt prefixes. AI, ML, and GenAI engineer interviews probe it because it is the current frontier of serving architecture and a real latency-SLO tradeoff.