Design an API that serves LLM inference

HardSystem design50 minSWEREPro outline

The question

Design the service behind an API that takes prompts and returns model completions, for a large model running on GPUs. Focus on batching, queueing and keeping GPUs busy while meeting latency targets.

What the interviewer is looking for

  • Separates prefill and decode costs
  • Uses continuous batching and explains why
  • Sizes the KV cache memory and lets it drive admission
  • Defines latency metrics: time to first token and per-token latency
  • Handles overload with queues, priorities and backpressure

Your answer

Saved in this browser only. Nobody else sees it.

Why this question

Written by BlogLLM in the style of a publicly reported Anthropic question type: design an API that serves LLM inference, covering batching, queueing and GPU utilization.

Reported in: interviewing.io

Practice question written by BlogLLM based on publicly reported interview formats. Not an official Anthropic question.