serving
Applied AI interview questions tagged serving, across every topic.
31 questions · 4 unlocked for you
Concepts behind "serving"
The curriculum that explains the ideas these questions test.
Foundational
Latency Budgets and StreamingLLM latency is not one number: time-to-first-token (set by prefill and queueing) and inter-token latency (set by decode) feel very different to users. Streaming tokens as they generate hides total latency by showing progress immediately. Designing to a latency budget means allocating time across retrieval, model, and tools, measuring TTFT and tokens-per-second (not just end-to-end), and using streaming, caching, and routing to hit it. Applied-AI interviews probe it because perceived latency makes or breaks LLM UX.⚙️ System Design for AI in Production
Foundational
GPU Memory and the Serving StackServing an LLM is mostly a memory problem: the GPU must hold the model weights plus a KV cache that grows with sequence length and batch size, and inference splits into a compute-bound prefill and a memory-bandwidth-bound decode. Knowing the memory math (weights plus KV cache), why decode is bandwidth-bound, and the levers (quantization, batching, paged attention) is the foundation of LLM serving. Applied-AI interviews probe it because 'will this model fit and how fast will it run?' is a constant production question.🖥️ ML Infrastructure & Serving
Core
Attention Variants: MHA, MQA, and GQAMulti-head attention gives every query head its own key and value heads, which is expressive but makes 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 hard, and grouped-query attention sits in between by sharing key-value heads across small groups. Applied-AI 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.🧠 Foundations of LLMs & GenAISign in
Core
The KV CacheDuring autoregressive decoding, a model would recompute attention over the entire history at every step; the KV cache stores each token's key and value vectors so each new token only attends, never recomputes. The win is compute; the cost moves to memory: the cache grows with sequence length times batch size and usually becomes the binding constraint in serving. Applied-AI interviews probe it because it explains why long contexts are expensive to serve, why throughput (not model speed) is often the limit, and why MQA/GQA and PagedAttention exist.🧠 Foundations of LLMs & GenAISign in
Core
Continuous BatchingGPUs are efficient on batches, but LLM requests arrive at different times and finish after different numbers of tokens, so static batching wastes the GPU waiting for the slowest request. Continuous (in-flight) batching adds and removes requests from the running batch at each decoding step, keeping the GPU full and dramatically raising throughput. Applied-AI interviews probe it because it is the single biggest throughput lever in LLM serving and explains why one replica can serve many concurrent users.🖥️ ML Infrastructure & ServingSign in
Advanced
Disaggregated Prefill/Decode and Prefix CachingLLM inference has two phases with opposite hardware profiles: prefill is compute-bound (it processes 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 fight, so long prefills stall ongoing decodes and you miss either the time-to-first-token or the time-per-output-token SLO. Disaggregation runs them on separate GPU pools and transfers the KV cache between them, and prefix caching reuses KV for shared prompt prefixes. Applied-AI interviews probe it because it is the current frontier of serving architecture and a real latency-SLO tradeoff.🖥️ ML Infrastructure & Serving🔒 Premium
