latency
AI, ML & GenAI interview questions tagged latency, across every topic.
32 questions · 2 unlocked for you
Concepts behind "latency"
The curriculum that explains the ideas these questions test.
Foundational
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.⚙️ System Design for AI in Production
Foundational
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.🖥️ ML Infrastructure & Serving
Core
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.🧠 Foundations of LLMs & GenAISign in
Core
Speech and Voice AI: ASR, TTS, and Voice AgentsVoice agents chain three systems: speech-to-text (ASR), an LLM, and text-to-speech (TTS), all under a hard real-time latency budget that text chat never faces. This page covers acoustic modeling and CTC basics, the cascade-versus-end-to-end tradeoff, and the conversational mechanics that actually break demos: turn-taking, barge-in, and the sub-second response budget. AI, ML, and GenAI interviews probe it because voice exposes whether you can reason about streaming, latency accounting, and a distinct class of failure modes.🧠 Foundations of LLMs & GenAISign in
Core
Diffusion Control and Fast SamplingA text prompt is a weak handle on an image model. Real control comes from structural conditioning: ControlNet for layout and pose, IP-Adapter for identity and style, masked inpainting for local edits. Speed comes from attacking three separate factors: the number of steps, the cost per step, and the passes per step. AI, ML, and GenAI interviews probe this because shipping an image product means hitting a latency budget and giving users control that a prompt alone cannot deliver.🧠 Foundations of LLMs & GenAISign in
Core
Prompt and Semantic CachingCaching ranks among the cheapest, highest-impact LLM optimizations. Prefix (prompt) caching reuses the computed attention state for a shared prompt prefix (a long system prompt or document), cutting prefill cost and latency. Semantic caching returns a stored answer for a query that is similar (not identical) to a past one, by embedding the query and matching nearest neighbors. AI, ML, and GenAI engineer interviews probe it because repetitive traffic is everywhere, and caching turns expensive recomputation into near-free lookups, with a correctness caveat for semantic caching.⚙️ System Design for AI in ProductionSign in
