AppliedAIPrep logoAppliedAI/Prep

latency

Applied AI interview questions tagged latency, across every topic.

28 questions · 2 unlocked for you

Concepts behind "latency"

The curriculum that explains the ideas these questions test.

Foundational
⚙️ System Design for AI in Production
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.
Foundational
🖥️ ML Infrastructure & Serving
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.
Core
🧠 Foundations of LLMs & GenAISign in
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.
Core
🧠 Foundations of LLMs & GenAISign in
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. Applied AI interviews probe it because voice exposes whether you can reason about streaming, latency accounting, and a distinct class of failure modes.
Core
⚙️ System Design for AI in ProductionSign in
Prompt and Semantic CachingCaching is one of 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 serves a stored answer for a query that is similar (not identical) to a past one, by embedding the query and matching nearest neighbors. Applied-AI interviews probe it because repetitive traffic is everywhere, and caching turns expensive recomputation into near-free lookups, with a correctness caveat for semantic caching.
Core
🖥️ ML Infrastructure & ServingSign in
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.