Deployed Lab

Module 6 · Capstone · Chapter 24 · Free

AI system design interview practice: timed exercises with model answers

19 min1 clickable picture1 break-it lab1 predict, 2 quick quizzes, 5-question final quiz5-min video review
In 30 seconds

The picture: a flight plan, filed before takeoff, so hard moments mid-flight are already decided.

What this chapter gives you
The cold open

A candidate at an invented company, Northwind Air, spends 30 of 45 minutes drawing a five-agent architecture for a support chatbot. The interviewer asks one question: "A storm cancels 400 flights. What happens?" Silence. No fallback, no eval plan, no answer for the one day the system matters. The feedback: "Strong components, no judgment." Components are cheap. Judgment is the job.

The plan for this chapter
  1. How the interview runs, and where the minutes go.
  2. Exercise 1: airline support copilot, with the teaching picture.
  3. Exercise 2: document Q&A for a law firm.
  4. Exercise 3: voice agent for pharmacy refills.
  5. Break-it lab: critique a flawed candidate answer.

Next: the shape of the session.

Step 1: How the interview runs

The split below is a common shape for a 45-minute session, not a promise about any one company.

MinutesPhaseWhat earns marks
0 to 5Clarify the briefWho uses it, what volume, what a wrong answer costs.
5 to 15Requirements and constraintsNeeds split from limits: latency, cost, privacy, accuracy bar.
15 to 30ArchitectureA simple first version, named patterns, data flow in order.
30 to 40One deep diveGo deep where the risk is: retrieval, a tool, a guardrail.
40 to 45Tradeoffs and risksWhat you gave up, what breaks first, how you would know.

Like a driving test: the examiner watches how you handle the hard junction, not how you recite the highway code.

Where the picture breaks down:

Worked example: budget the deep dive. Overrun clarifying by 4 minutes (illustrative) and the cost lands at the end: 5 minutes of tradeoffs becomes 1. Tradeoffs are where seniors separate, so set a hard stop at minute 15 for the sketch. Arithmetic: 5 + 10 + 15 + 10 + 5 = 45.

Next: exercise 1, the airline copilot. Set a 45-minute timer for the real feeling.

Step 2: Exercise 1, a support copilot for an airline

The prompt, as an interviewer would say it: "Design a support copilot for a mid-size airline. It answers passenger questions and helps rebook flights."

Your plan: 0 to 5, clarify (channels, can it act or only advise?). 5 to 15, requirements: peak load on disruption days, refund rules, identity checks. 15 to 30, the architecture below. 30 to 40, deep dive on storm rebooking. 40 to 45, tradeoffs.

Model answer, in words: a router (Chapter 7) sends simple questions to retrieval over policy pages (Chapter 5) and actions to a single agent (Chapter 8) with two tools, flight status and rebook, returning structured output (Chapter 6). A guardrail layer (Chapter 10) checks every proposed change before it executes; money and identity go to a human. The real test is disruption days: design for the storm, then shrink to a calm day.

Airline support copilot architecture A router sends simple questions to retrieval and actions to an agent with flight tools, checked by a guardrail, with a human for money and identity. Passengerchat or app Routerask or act? Retrievalpolicy pages Agent + toolsstatus, rebook Guardrail check Humanmoney, ID
  1. "My flight was cancelled, what now?" The router decides: asking, or asking the system to act?
  2. Policy questions get grounded answers from the policy pages, source named.
  3. The agent checks flight status first, then proposes a new flight.
  4. The guardrail verifies the proposal against fare rules and the booking before anything changes.
  5. Refunds and identity disputes go to a person. On a storm day, this queue is the design.
Probe you will getStrong line
"A storm cancels 400 flights at once."Cache flight status (Chapter 12), degrade to status-only answers, humans take priority rebooking.
"How do you know rebooking works?"Eval set of past disruption chats (Chapter 11), scored on correct rebook and zero policy violations.

Failure answers to avoid: a multi-agent swarm for a two-tool job, and "the model will follow the refund policy in the prompt" (a prompt is not a guardrail).

Next: exercise 2, where documents fight back.

Step 3: Exercise 2, document Q&A for a law firm

The prompt: "Design a system where lawyers ask questions across client documents and get answers usable in court filings."

Your plan: 0 to 5, clarify (document types, who may see what). 5 to 15, requirements: permissions per matter, citations on every claim. 15 to 30, architecture. 30 to 40, deep dive on permission-aware retrieval. 40 to 45, tradeoffs.

Model answer, in words: ingestion tags every chunk with its matter and access list. Retrieval (Chapter 5) filters by the asking lawyer's permissions before ranking, never after. Answers use structured output (Chapter 6): claim, citation, page. No citation, no claim: the system says "not found in your matters" instead of guessing. A leaked document or invented quote ends the product.

Probe you will getStrong line
"A partner asks about a matter she is not on."The filter runs before retrieval, so those chunks never reach the model. It cannot leak what it never saw.
"How do you test citation quality?"Eval loop (Chapter 11): sampled answers checked for citation supports claim.

Failure answers to avoid: filtering results after generation (the model already saw the text), and one shared index plus a polite prompt about confidentiality.

Filtering after generation is too late: the model has read the chunk and can restate it in new words. Filter at retrieval, before ranking.

Next: exercise 3, the voice agent.

Step 4: Exercise 3, a voice agent for pharmacy refills

The prompt: "Design a voice agent that reminds patients about prescription refills and confirms orders."

Your plan: 0 to 5, clarify (inbound, outbound, or both; which drugs are excluded). 5 to 15, requirements: latency under about a second per turn, identity confirmation, escalation to a pharmacist. 15 to 30, architecture. 30 to 40, deep dive on confirmation. 40 to 45, tradeoffs.

Model answer, in words: speech to text, a small fast model behind a router (Chapter 7), streaming replies (Chapter 13) so the patient hears words early. State lives outside the model: refill status, confirmed or not, attempts made (memory, Chapter 9). The agent never confirms on a fuzzy match: it reads back drug name and dose, and any doubt escalates to a pharmacist. A wrong "yes" has a person's health behind it.

Probe you will getStrong line
"The patient says 'yes' but the audio is unclear."Unclear is a no. Ask once more, then escalate. Confirmation needs a clean signal.
"Replies feel slow."Stream output, cache fixed phrases (Chapter 12), fall back to a smaller model (Chapter 14).

Failure answers to avoid: one giant model call per turn with full history (latency grows every turn), and letting the agent answer dosage questions because "it usually gets them right".

Next: the break-it lab, your red pen.

Step 5: Break-it lab, critique a flawed candidate answer

Why this exercise: spotting weak design in someone else's answer stops you producing it yourself. The checklist is the course: patterns matched to constraints, guardrails, an eval loop, honest data handling.

Do this:

  1. Read the answer below and list every fault before opening the hint.
  2. Sort the statements in the lab under it into the flaw categories.
  3. Open the reveal and score yourself: four faults found is a strong critique.

The candidate answer, for a clinic's patient messaging assistant (illustrative):

DESIGN: "CareChat" patient assistant
- Architecture: 9 specialised agents debate each reply
  before sending (planner, drafter, critic, and 6 more).
- Output: stream raw model output straight to the patient
  screen, token by token, no review layer.
- Quality: no test set. "We will monitor user feedback
  and fix problems as patients report them."
- Data: keep every conversation and health detail forever,
  "for training", no deletion process.
- Tools: the agent can book, cancel and message the
  patient's doctor directly, no confirmation step.
Hint

Check four things: is the architecture sized to the job, what sits between the model and the patient, how quality is measured before launch, and how long personal data lives. Also check what tools can do without asking.

Reveal: the faults and the fixes

Lab: In the chapter's break-it lab, a candidate designs CareChat, a clinic's patient messaging assistant, and the answer sounds confident. This lab runs in your browser and needs JavaScript enabled.

What to notice

Next: a field note, then mix-ups.

Field note, November 2026

Interviewers commonly report that candidates who state assumptions, name a metric, and describe how they would test the design outperform candidates with larger diagrams. Treat that as interviewer lore, not a measured statistic, and practise accordingly: timed, out loud, with a peer interrupting.

Mix-ups to avoid

Chapter quiz

Five questions. Score 70% to complete.

Review this chapter in 5 minutes

Watch the whole chapter recapped: the 45-minute interview shape, three timed model answers, the probes, tradeoff language, and the CareChat critique lab.

Decision rule: name the constraint, the pattern that answers it, and how you would test it. If one is missing, the design is not finished.

Review

Glossary

Clarifying question
Pins down users, volume or risk before designing. Example: "Can it act, or only advise?"
Deep dive
The one part of a design explored in detail. Example: permission filtering in retrieval.
Model answer
A worked example of a strong response. Example: the airline walk in Step 2.
Probe
A follow-up that tests a weak spot. Example: "A storm cancels 400 flights. What happens?"
Tradeoff
What you give up to gain something. Example: human review costs speed, buys safety.
Failure answer
Sounds plausible, loses marks. Example: "The prompt tells the model to follow policy."
Eval plan
How quality is measured before and after launch. Example: 200 labelled cases, one pass bar.
Escalation
Handing a case to a human when risk is high. Example: a pharmacist takes an unclear call.
Scope change
A new requirement added mid-design. Example: 40 languages at minute 20.

Next: "Back to the course map, and your next design review."