← Questions

Design large-scale model inference serving with back-of-envelope sizing

0
WaymoSystem designLast asked Nov 2025

An AI system design interview question asked in Waymo's technical phone screen, last asked Nov 2025. It tests model serving, capacity planning and latency.

Design a production system that serves a machine learning model to 100 million daily active users. Start from traffic assumptions and back-of-the-envelope numbers, then design for latency, tail latency and reliability, including how you prevent and recover from out-of-memory failures.

Requirements

  • Functional: serve predictions through an API; roll out new model versions; route traffic across regions.
  • Non-functional: peak queries per second from 100M DAU; a latency target at p50 and p99; high availability; memory and bandwidth within the hardware's limits; cost per query under control.

Clarifying questions

  • What kind of model (ranking model, vision model, LLM), and how big?
  • How many requests per user per day, and how peaky is traffic?
  • What latency target, and is it per request or per generated token?
  • Are there CPU-only or edge options, or only data-center accelerators?
  • How fresh must the model be (how often redeployed)?

What a strong answer covers

  • QPS: for example 100M users × 20 requests a day ≈ 2 × 10^9 a day ≈ 23K QPS on average, around 2–3× that at peak; assumptions stated and adjustable.
  • Memory per replica: weights (parameters × bytes per parameter), activations per batch, KV caches for LLMs (layers × 2 × heads × head dim × sequence length × batch × bytes), plus headroom.
  • Bandwidth: inference on large models is often memory-bandwidth bound; tokens per second per GPU ≈ memory bandwidth / bytes read per token; network bandwidth for request and response sizes.
  • Hardware choice: CPUs for small models and light traffic, GPUs or specialized accelerators for large models; replicas needed = peak QPS / per-replica throughput at the latency target.
  • Latency: dynamic batching with a maximum wait, quantization, caching of repeated requests, model parallelism only when the model doesn't fit; tail latency via admission control, hedged requests, and isolation of slow requests.
  • OOM: cap batch size and sequence length by memory budget, preallocated or paged caches, load shedding, and fast restart with traffic draining.
  • Autoscaling, canary rollouts, and monitoring of QPS, latency percentiles, GPU memory and error rates.

Follow-ups

  • Traffic doubles in a minute after a launch.
  • Serve two model sizes and route each request to the cheaper one when possible.
  • One region fails at peak.

Where it's asked

  • Waymo · Technical phone screen · Last asked Nov 202545 min · Coding: a classic algorithm problem or an original, under-specified problem framed around self-driving

What it tests

model serving · capacity planning · latency · gpu

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing