Design an LLM Serving System at Low Latency

Last updated: September 4, 2025

Quick Overview

Serve millions of LLM queries per day with sub-second time-to-first-token. Cover batching, KV-cache management, model sharding, streaming delivery, and autoscaling.

Perplexity
System Design
Software Engineer
Perplexity
September 4, 2025
Software Engineer
System Design Round
System Design
Hard

11

7

4,150 solved


Serve millions of LLM queries per day with sub-second time-to-first-token. Cover batching, KV-cache management, model sharding, streaming delivery, and autoscaling.

Perplexity serves tens of millions of queries daily. LLM inference latency directly impacts user experience and retention.

What the Interviewer Expects
  • Design batching strategies for GPU utilization
  • Implement KV-cache management for memory efficiency
  • Address model sharding and tensor parallelism
  • Design streaming token delivery via SSE
  • Plan autoscaling under variable load patterns
Key Topics to Cover
LLM inference optimization
KV-cache
Tensor parallelism
Speculative decoding
GPU autoscaling
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you handle cold start latency?
  • What is your strategy for model updates without downtime?
  • How do you manage cost per query?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Inference Architecture

Deploy models across GPU clusters using tensor parallelism (split model layers across GPUs) for large models and data parallelism (replicate models) f...

KV-Cache and Memory

KV-cache stores attention keys and values from previous tokens, avoiding recomputation. For long contexts, this can consume significant GPU memory. Im...


Submit Your Answer
Markdown supported

Related Questions