← Questions

Fast expensive tokens versus slow cheap tokens

0
GoogleSystem designLast asked Jan 2026

An AI system design interview question asked in Google's first round (coding), last asked Jan 2026. It tests llm serving, cost and latency.

Your AI product can serve each request with one of two inference options: option A costs more per token but answers with low latency; option B costs less per token but is slower. How do you decide which to use?

Requirements

  • Functional: a policy, possibly per request, that picks A or B for each feature and workload.
  • Non-functional: a good user experience, answer quality at least as good as today, reliability when one option degrades, and an operating cost the business can carry.

Clarifying questions

  • Is the output quality the same on both, or only the speed and price?
  • Which features are interactive (chat, autocomplete) and which are background (summaries, batch enrichment, evaluations)?
  • What latency does each feature need, measured as time to first token or total time?
  • What is the budget, and how much traffic is there?

What a strong answer covers

  • Segmenting workloads: interactive features where latency drives retention, against offline and batch jobs where cost dominates and a delay is invisible.
  • The metrics: time to first token, tokens per second, p95 total latency, cost per request and per user, quality scores, error and timeout rates, conversion or retention by latency bucket.
  • A dynamic router instead of one global choice: rules by feature and user tier, request size, current queue depth or latency of each option, a fallback from one to the other on errors or overload, deadlines.
  • Tricks that change the trade-off: streaming hides latency, caching, smaller prompts, speculative or parallel requests for critical paths.
  • Proving it with experiments: A/B tests of latency against engagement, then a cost model that sets the routing thresholds.

Follow-ups

  • Option A has an outage. What does the router do?
  • A user's first message is latency-critical but follow-ups are not. Would you mix options in one conversation?
  • How do you avoid quality regressions when moving a workload to the cheaper option?

Where it's asked

  • Google · First round: coding · Last asked Jan 202645 min · Coding in a Google Doc, no syntax highlighting or autocomplete · No AI

What it tests

llm serving · cost · latency

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