AI System Design
How to structure a 45 to 60 minute AI system design answer: the layers every design walks through, the framework, what interviewers grade and the mistakes that sink candidates. Pair it with the drill and the 20 worked case studies on the System design page.
Card 1 of 6
The 5-layer spine
A quick note before we get started. This is how we look at every one of these problems, and it is worth saying why up front. When you sit down to design an AI system, you need a structure to hang your reasoning on, or you jump straight to a vector database or a model name and skip the decisions that actually matter. These 5 layers are that structure. Most AI systems can be reasoned about as some combination of them, which is why we lead with the spine before touching the specific problem.
This is not the only way to do it, and it is not a universal template. It is a starting point. You decide which layers are load-bearing for the problem in front of you and go deep there, and as systems get more complex you will reach past this spine into more innovative approaches.
- Layer 1, the model. The model at the center. Which model, why, and how you handle its non-determinism.
- Layer 2, the wrapping layer, or the architecture. Knowledge (retrieval), tools, and memory composed around the model. This is where most of the design lives.
- Layer 3, evals and guardrails. How you know any of it is good, and how you stop the bad in real time. Offline sets that gate releases, and online checks that act as guardrails on live traffic.
- Layer 4, production and ops. The loop that makes it real: scale, latency, cost, reliability, observability.
- Layer 5, optimization. Where you make a working system better and take on harder problems: model routing, caching, advanced retrieval, and multi-agent when one agent is not enough.
Composing these layers into one coherent system is what we mean by system design. Each case study below walks these layers for its own problem, going deepest where that problem is hardest.
+-------------+
| 1 MODEL | the model, the brain
+------+------+
|
+------------- 2 WRAPPING LAYER (ARCHITECTURE) --------------+
| [ Knowledge / RAG ] [ Tools ] [ Memory ] | the architecture
+---------------------------- + -----------------------------+ around the model
|
+-------------+--------------+
| |
3 EVALS & GUARDRAILS 4 PRODUCTION & OPS
(is it good? stop the bad) (keep it alive at scale)
| |
+----------------------- 5 OPTIMIZATION --------------------------+
| make it better: routing, caching, advanced retrieval, |
| multi-agent when one agent is not enough |
+-----------------------------------------------------------------+
system design = composing all of the above into one coherent system
All 11 AI System Design questions
Quick-fire
- Design a customer support agent for an enterprise. Walk me through it.
- Design a RAG system over 10 million internal documents with per-user access control.
- Design the evaluation and monitoring system for an LLM feature already in production and getting hallucination complaints.
- Design an insurance-claims agent that ingests a claim and outputs approve, deny, or needs-review.
- How do you cut the p95 latency of a feature that makes one reasoning-model call per request?
- Design a code assistant that answers questions over a large private codebase with a 2-second latency budget.
- Design a multi-tenant LLM application. What is different from a single-tenant one?
- Design a document-processing pipeline that extracts structured data from messy PDFs at scale.
- You need to migrate a production feature from an expensive model to a cheaper one. How do you do it safely?
- Design a system to detect and reduce hallucinations in a generative feature.
- Design a semantic caching layer for an LLM API to cut cost. What are the failure modes?