System design drill
Most AI design rounds run 45 to 60 minutes and you drive them. Spin a prompt, start the clock, and talk through each phase before you read a worked case study.
Your prompt · from the AI Engineering Field Guide
Design a model deployment platform: serving, GPU autoscaling, versioning and result caching.
Phase 1 of 5: Clarify
Drill complete.
Now compare: open the closest case study below and note what you missed.
Get grilled
Summarise your design in a few lines. The on-device AI interviewer says what is strong and asks the three sharpest follow-ups. Without WebGPU, use the checklist above as your interviewer.
20 worked case studies
Cases 1 to 10 come from AI-Engineer-Interview-Questions: requirements, architecture, evaluation plan, cost, failure modes and follow-ups. Cases 11 to 20 come from the Awesome Generative AI Guide: each walks a 5-layer spine and ships runnable reference code. The worked design stays hidden until you ask for it.
Case 1
Enterprise RAG Assistant
A 20,000-person company has knowledge scattered across Confluence, Google Drive, Notion, Jira, Zendesk, and Slack. Employees waste time searching six …
Case 2
AI Code Assistant
Build a Copilot-class assistant for a company with 50,000 developers (or as a product for that many users). Three surfaces with wildly different const…
Case 3
E-commerce Support Agent at 100k Contacts a Day
An e-commerce company handles ~100k support contacts/day across chat and email, at ~$6 fully-loaded cost per human-handled contact. Build an agent tha…
Case 4
Semantic Search at Scale
Replace/augment lexical product search with semantic retrieval for a large marketplace: 100M active listings, heavy query volume, hard latency budget …
Case 5
Content Moderation Pipeline at 10M+ Items/Day
Build an automated content moderation system for a user-generated-content platform. Every new post, comment, username, and image must be screened agai…
Case 6
Document Intelligence Pipeline (Invoices & Contracts at Scale)
Customers upload documents (PDF, scans, photos, emails with attachments). The system must classify each document, extract a structured record against …
Case 7
Text-to-SQL Agent over a Data Warehouse
Design a natural-language analytics agent over an enterprise data warehouse (Snowflake/BigQuery/Databricks-class). Users ask questions like "what was …
Case 8
AI Meeting Assistant (Transcription, Notes, Action Items)
Build the backend for a meeting assistant that: (1) captures audio from Zoom/Meet/Teams via bot participant or native integration, (2) produces a live…
Case 9
Real-Time Voice Agent (Phone Reservations and Helpline)
A restaurant group runs 400 locations plus one central reservations line. Roughly 60k inbound calls/day land on a phone tree that most callers hate, a…
Case 10
LLM Gateway & Serving Platform
Forty product and internal teams each discovered LLMs independently. Today that means five sets of provider credentials in five secret stores, no idea…
Case 11 · with code
Customer Support Agent with Tools and Human Handoff
Design a customer support agent for an e-commerce company. It reads the help center and answers questions, can look up an order and open a support tic…
Case 12 · with code
Enterprise Research Assistant
Design an enterprise research assistant that answers employee questions across many internal sources (docs, wikis, tickets, code, chat) with citations…
Case 13 · with code
Analytics Copilot (Text to SQL)
Design an analytics copilot that answers business questions over a data warehouse in natural language (text to SQL). A user types a question like 'wha…
Case 14 · with code
Financial-Operations Decisioning Agent
Design an agent that processes a repetitive financial-operations workflow end to end, for example invoice approval or expense audit: extract the facts…
Case 15 · with code
Security and Compliance Agent
Design an agent that monitors activity streams for policy violations and anomalies and enforces compliance in real time. Walk me through it.
Case 16 · with code
Coding Agent
Design a coding agent that takes a natural-language task, edits a repository, runs tests, and opens a pull request. Walk me through it.
Case 17 · with code
Document Decisioning Agent for Insurance Underwriting
Design a document decisioning agent for insurance underwriting: read the submitted documents, extract the facts, apply underwriting policy, and produc…
Case 18 · with code
Real-Time Voice Customer Support Agent
Design a real-time voice customer support agent for a phone line. A caller phones in, the agent answers in natural speech, grounds its answers in the …
Case 19 · with code
SDR (Sales-Development) Agent
Design an SDR (sales development) agent that qualifies inbound leads and drafts personalized outreach. It reads a lead from the CRM, enriches it with …
Case 20 · with code
Clinical Documentation Assistant
Design a clinical documentation assistant that turns a patient encounter transcript into a structured clinical note. Walk me through it.
The answer framework
AI system design is now a standard interview loop stage for AI/GenAI/LLM engineer roles at frontier labs, big tech, and AI startups - usually a 45-60 minute whiteboard session like "Design a customer support agent" or "Design semantic search for our catalogue." It tests whether you can turn a fuzzy product idea into a shippable, measurable, affordable system with a model inside it. Senior candidates fail this round more often on missing evals and cost math than on missing boxes in the diagram.
How these interviews differ from classic system design
Classic system design intuitions still apply (load balancing, sharding, caching, queues), but four things change fundamentally:
| Dimension | Classic system design | AI system design |
|---|---|---|
| Core component | Deterministic services you write | A model you don't fully control - treated as a fallible, versioned dependency |
| Correctness | Provable: tests, invariants, ACID | Probabilistic quality: you can't prove correctness, so evals replace correctness proofs - you argue with measured accuracy, faithfulness, task success rates |
| Cost model | Mostly fixed infra; marginal request cost ≈ 0 | Cost per request is significant (fractions of a cent to dollars). Token math is the new capacity planning; model choice is a first-class cost lever |
| Latency | Single number (p99 of an RPC) | Shaped latency: time-to-first-token vs tokens/sec vs total; streaming UX; agent loops take seconds-to-minutes |
| Failure modes | Crashes, timeouts, data loss | Plus semantic failures: hallucination, prompt injection, refusal, drift after a silent model update |
| Iteration | Ship features | Quality flywheel: log traces → build eval sets → improve prompts/retrieval/models → re-measure |
If your answer would be identical with a deterministic service where the model sits, you're not answering an AI system design question.
The 8-step answer framework
Use this skeleton for any prompt. In a 45-minute interview: ~5 min on step 1, ~10 min on steps 2-3, ~15 min on step 4, ~15 min on steps 5-8 (interviewers weight evals and ops heavily - don't run out of time before them).
1. Requirements & success metrics
Clarify users, scale (QPS, corpus size, growth), latency expectations, and what "good" means numerically - e.g. "answer accuracy ≥ 90% on a golden set, deflection rate ≥ 50%, p95 TTFT < 1.5s, cost < $0.05/query." Name the north-star metric and the guardrail metrics before drawing anything.
2. Model strategy
API vs self-host (data sensitivity, scale economics, latency control, ops burden), and tiering: route easy/high-volume traffic to a small cheap model, hard traffic to a frontier model. State fallbacks across providers and how you'll pin + upgrade model versions.
3. Data & context strategy
How does the model get the knowledge it needs? Default decision order: prompting → RAG → tools → fine-tuning. RAG for facts that change; fine-tuning for style/format/narrow skills, not knowledge freshness; tools for live state and actions. Define chunking, indexing, freshness pipeline, and ACLs here.
4. High-level architecture
Draw the request path: client → gateway → (router) → orchestration → retrieval/tools → model → guardrails → response, plus the offline paths (ingestion, eval, training). Say what's synchronous vs queued, what's cached, where state lives.
5. Evals & quality loop
The step that separates seniors: a golden set (100-1,000 labelled cases), automated scoring (exact-match where possible, LLM-as-judge with a rubric where not, calibrated against human labels), component-level metrics (retrieval recall@k separate from answer faithfulness), CI gating on prompt/model changes, and online A/B or interleaving.
6. Deployment & ops
Latency budget per stage, streaming, caching (prompt caching, semantic caching, KV cache implications), rate limits and provider quota management, graceful degradation (fallback model, "I don't know" responses, cached answers), tracing every LLM call with prompt/version/tokens/latency.
7. Safety & guardrails
Input guards (injection detection, PII redaction, topic filters), output guards (schema validation, citation checks, moderation), action guards for agents (allowlisted tools, spend/blast-radius caps, human approval for irreversible actions), and tenant isolation.
8. Iteration plan
What ships in week 1 vs quarter 1: start with the simplest system that can be measured (often a single prompt + retrieval), instrument everything, and let eval data drive complexity. Explicitly name what you would not build yet.
Reusable building blocks
Most AI systems assemble the same ~10 blocks. Naming these fluently signals experience:
| Block | What it does | Design notes |
|---|---|---|
| Model gateway | Single choke point for all LLM calls: auth, quotas, retries, provider failover, usage metering | Buy or build thin; never let services call providers directly |
| Router | Sends each request to the right model tier (small/fast vs frontier) by classifier, heuristics, or task type | Biggest single cost lever; measure quality delta per tier |
| Retrieval service | Hybrid (BM25 + dense) search over chunked, permission-tagged corpus with reranking | Own service with its own evals (recall@k, nDCG) |
| Context builder | Assembles the prompt: system instructions, retrieved chunks, memory, tool schemas, under a token budget | Deterministic and testable; log the exact final prompt |
| Orchestrator | Runs multi-step flows: agent loops, tool dispatch, retries, timeouts, max-iteration caps | Durable execution (queue-backed) for long-running agents |
| Guardrails layer | Input/output/action checks: injection, PII, schema validation, moderation, policy engine for tool calls | Fail closed on actions, fail open (with logging) on style |
| Eval harness | Runs golden sets against any prompt/model/retrieval config; scores, diffs, gates CI | Version everything: prompts, datasets, judge prompts |
| Tracing & observability | Per-request trace of every model call, tool call, retrieval, with tokens/cost/latency/feedback attached | The raw material for eval sets and debugging |
| Caches | Exact-match response cache, semantic cache, provider prompt caching for shared prefixes | Prompt caching often cuts input cost 50-90% or more on long shared contexts; some providers now charge for cache writes, so count those too |
| Feedback store | Thumbs, edits, acceptances, escalations, linked to traces | Feeds the quality flywheel and fine-tuning data |
| Human-in-the-loop queue | Review UI for low-confidence outputs and high-risk actions | Design the escalation path before the model is trusted |
What interviewers grade
- Clarifying questions first. Jumping straight to an architecture is the most common fail. Scope, scale, quality bar, and constraints are never fully specified on purpose.
- Tradeoff articulation. Every choice ("RAG over fine-tuning", "self-host the completion model") stated with the alternative, the reason, and what would change your mind.
- Eval literacy. Can you say concretely how you'd know the system works - datasets, metrics, judges, online experiments? This is the sharpest senior/junior discriminator in 2026 loops.
- Cost awareness. Back-of-envelope token math: requests/day × tokens/request × $/token. Being within 10x with clearly stated assumptions is the bar.
- Pragmatism. Simplest thing first, complexity justified by measured need. "I'd start with one prompt and a golden set" beats a 12-box agent swarm.
- Failure-mode thinking. Injection, hallucinated citations, provider outage, silent model updates, stale indexes - raised unprompted.
- Latency realism. Knowing that TTFT, streaming, and agent loop counts dominate perceived speed, and budgeting per stage.
Red flags interviewers watch for
- Designing for the model as an infallible oracle - no eval plan, no fallback, no "when it's wrong" path.
- Fine-tuning as the first answer to a knowledge-freshness problem.
- No numbers anywhere: no QPS, no token counts, no cost estimate, no latency budget.
- Agent maximalism: multi-agent swarms for a problem a single prompt + retrieval solves.
- Ignoring ACLs/tenancy in enterprise scenarios ("just embed everything into one index").
- Treating "LLM-as-judge" as free and infallible rather than a component that itself needs calibration.
- No mention of prompt injection when the design ingests untrusted content or takes actions.
Further reading
- Building Effective Agents - Anthropic - the canonical "start simple, add agency only when needed" argument.
- Patterns for Building LLM-based Systems & Products - Eugene Yan - evals, RAG, guardrails, caching as reusable patterns.
- What We Learned from a Year of Building with LLMs - O'Reilly - practitioner field notes across the whole stack.
- LLM Powered Autonomous Agents - Lilian Weng - the reference taxonomy for agent components.
- Lost in the Middle: How Language Models Use Long Contexts - why context assembly and ordering matter.
- Hidden Technical Debt in Machine Learning Systems - the classic on why the model is the small box in the diagram.
- Designing Data-Intensive Applications - Kleppmann - the classic-system-design half of the interview still rests on this.