Grokking the AI System Design Interview
Vote

0% completed

​

A Framework for AI Design Answers

Seven Steps, In Order

Step 1: What Are We Designing?

Step 2: What Does Success Mean?

Step 3: What Data Do We Have?

Step 4: What Is the Simplest Model That Works?

Step 5: How Do We Serve It?

Step 6: How Does It Keep Working?

Step 7: What Breaks, and What Does It Cost?

In the Interview

TL;DR

Seven Steps, In Order

The classic system design interview structure is: requirements, estimates, APIs, high-level design, detailed discussion, and a summary.

This structure also works for AI questions. This course makes two concerns explicit: measuring output quality and improving the system after it starts serving users.

What AI adds to the classic interview structure.
What AI adds to the classic interview structure.

First, define quality metrics early so you can evaluate later design choices against them.

Second, explain how you will monitor outcomes and safely improve the system. Do not stop after describing how a response reaches the user.

The course organizes these decisions into seven steps. Each step answers a question you can state during the interview.

The seven steps, and the question each one asks.
The seven steps, and the question each one asks.

Use these seven steps as a starting structure for practice. The order helps you make decisions using requirements and data, rather than choosing components first.

Here is one way to divide a 45-minute interview.

StepMinutes
1. Frame the problem3
2. Define success5
3. Map the data5
4. Pick the model5
5. Design the serving path12
6. Keep it working8
7. Count the costs5

These steps total 43 minutes, leaving two minutes for final questions. Follow-up questions may also arise throughout the discussion, so treat the times as a guide.

Adjust the emphasis to the question. Predictive systems may need more discussion of data and models. Generative systems may need more discussion of inference and context. Agentic systems need careful discussion of tool permissions and limits.

Cover every relevant decision, but adapt the order and depth when the interviewer asks you to focus elsewhere.

Step 1: What Are We Designing?

Before designing the system, explain your understanding of the task.

1. Name the family. Use the test from The Three Question Families. Does the system mainly produce predictions, content, or actions?

This suggests an initial architecture, such as candidate selection and ranking, a generation pipeline, or an agent with explicit limits. A mixed product may need more than one.

2. Name the known system, if you can. A question may resemble a design you already know.

For example: "This is a recommendation system where the items are podcasts." Or: "This is document question answering with stricter accuracy requirements."

Use the known design as a starting point, then check which requirements differ. Do not assume that an existing architecture fits without changes.

Next, state the scope: what you will include, what you will exclude, and why.

For example: "I'll design text-only support in English first. Voice and additional languages are outside this version."

Confirm the choice: "Does that scope match what you want to discuss?"

This reduces the risk of spending the interview designing a different system from the one intended.

Step 2: What Does Success Mean?

Turn the product goal into measurable requirements. State assumptions when the interviewer does not provide targets.

1. Quality. Choose metrics that reflect the task.

"Users find videos they enjoy" might lead to click-through rate and watch time, together with checks for satisfaction and unwanted content.

"Helpful support bot" might lead to correct resolution rate, customer satisfaction, and the rate of repeated contacts about the same issue.

2. Latency. Define how long users can wait. A feed may need to load within a few hundred milliseconds. A chatbot may have separate targets for the first visible output and the complete answer. A background batch job still needs a completion deadline and a data-freshness target.

These requirements affect what can be computed in advance and what must happen during a request.

3. Scale and cost. Estimate users, request volume, peak requests per second, and cost per request or completed task.

A free feature may need a very low cost per request. A support feature may justify a higher cost if it resolves issues reliably and reduces total support costs. Use a concrete budget rather than "near zero."

Step 3: What Data Do We Have?

Name the data sources that the design needs:

  • Interaction logs, such as clicks, watches, and purchases.
  • Content and catalog data.
  • User profiles, where access and use are permitted.
  • Documents or other information needed for generated answers.

Then ask two questions.

1. Where do labels come from? In supervised learning, a label is the target value or category for a training example. Labels can be incomplete or incorrect.

Fraud systems may use confirmed investigations and chargebacks, but chargebacks arrive late and do not all prove fraud. Feed systems may use clicks, which arrive quickly but are an imperfect signal of satisfaction.

Support systems may use reviewed conversations, verified resolutions, and user feedback. A thumbs-up or thumbs-down is useful feedback, but it is not always a reliable correctness label.

Supervised training needs suitable labels. Other approaches, such as self-supervised learning or using a pretrained model, do not require a manually labeled dataset for every new task. In all cases, explain how you will evaluate results.

2. How fresh must the data be? Some recommendations can use daily updates. Trending content or fraud detection may need much fresher signals. Confirm the requirement rather than assuming a fixed interval.

Freshness helps determine whether batch processing, streaming, or request-time lookups are needed.

Step 4: What Is the Simplest Model That Works?

Start with a baseline that can meet the basic requirements. It helps you test the pipeline and gives you a result to compare against.

Predictive family. For recommendations, popular items can be a baseline before a learned ranker. For other prediction tasks, use an appropriate rule or simple model.

Generative family. Start by evaluating an existing model with clear instructions. Add retrieval when answers require external or private information. A hosted model is one option, subject to privacy, latency, and cost requirements.

Fine-tuning means giving an existing model additional training. Consider it when evaluation shows a specific need that simpler changes do not address.

State a condition for upgrading, such as: "If the baseline misses the quality target, I will compare a tuned model with the current approach."

Agentic family. Start with a fixed workflow if the steps are known. If the model needs to choose the next step, start with one agent and a small set of narrowly permitted tools.

Multiple agents add coordination, evaluation, and operating costs. Use them only when the task benefits from that separation.

Explain the next option you would test and the evidence that would justify it.

Step 5: How Do We Serve It?

Draw the architecture and trace a request through it. This is often a large part of the discussion.

The design may use candidate selection and ranking, retrieval followed by generation, or an agent that selects tools within defined limits.

The following four serving questions apply across these designs.

Four serving questions to consider in step 5.
Four serving questions to consider in step 5.
  1. What can run offline, ahead of time, and what must run online, for each request? Precompute when freshness, storage, and reuse make it worthwhile.
  2. Where are the caches? Estimate their effect on response time and cost. Define freshness, invalidation, and permission rules so cached results do not expose another user's data.
  3. Which requests can use a lower-cost option, such as a smaller model, a cached answer, or a rule? Which require a more expensive model to meet the quality target?
  4. What happens when the model is slow, unavailable, or rate-limited? Set timeouts, bounded retries where safe, and a fallback or clear failure response. For background jobs, define deadlines and recovery behavior.

Step 6: How Does It Keep Working?

Show the feedback process in the diagram:

  • Record the inputs, outputs, and versions needed for evaluation, with privacy controls and appropriate retention.
  • Capture outcome signals, such as clicks, reviewed ratings, escalations, or confirmed fraud reports.
  • Measure the quality metrics from step 2 using live outcomes and reviewed samples.
  • Use the findings to improve data, retrieval, instructions, or models.

Then explain how changes will be released safely.

Start with offline evaluation. Depending on the risk, use a shadow deployment, a controlled experiment, or both before a gradual rollout. Define conditions for stopping the rollout and restoring the previous version.

A shadow deployment evaluates a new version on copied traffic without returning its outputs to users. If the system can take actions, disable or simulate those actions during the comparison.

The design should explain both how requests are served and how quality is maintained.

Step 7: What Breaks, and What Does It Cost?

Finish with risks and a cost estimate.

Failure list. Identify failures specific to your system: unsupported answers, changing data patterns, unsafe actions, or feedback that reinforces unwanted behavior. For example, optimizing only for clicks may encourage the system to recommend misleading content.

Describe a control for each risk, such as reviewed thresholds, quality monitoring, content checks, permission limits, or a way to disable a feature. State what the control cannot guarantee.

Cost list. Estimate model cost as request volume, multiplied by the share of requests that use each model, multiplied by that model's cost per call. Include multiple calls per request when relevant.

For example, using assumed values: "At 10 million requests per day, if 20 percent call the large model once at 0.01 per call, that part costs 20,000 per day."

This excludes smaller-model calls, retrieval, storage, retries, and other operations. Compare the total estimate with the budget before proposing optimizations.

💡 If time is short, summarize steps 6 and 7: "I would connect predictions with outcomes, investigate quality changes, evaluate updates before gradual rollout, and monitor cost. The first two risks I would track are X and Y." Choose a retraining schedule only when the data and requirements justify it.

In the Interview

The 30-second answer (your opening after an AI design question): "I'll clarify the task and scope, define quality, latency, and cost targets, and identify the data. Then I'll choose a baseline and design how requests are served. I'll finish with evaluation, safe updates, failure handling, and a cost estimate. First, this looks like..."

Likely follow-ups:

  1. "Skip ahead to the architecture." State the key assumptions briefly: "I will assume the quality target is X and the response-time limit is Y." Then draw the design. Revisit missing requirements when they affect a decision.
  2. "You have ten minutes, not forty-five." Focus on the scope, main architecture, biggest risk, and cost. Briefly state the quality target, data assumptions, and evaluation approach rather than omitting them entirely.

TL;DR

The seven stepsFrame the problem, define success, map the data, pick the model, design the serving path, keep it working, and count the costs.
Step 1 ruleIdentify the family, adapt a relevant design, and confirm the scope.
Step 2 ruleDefine measurable quality, latency, scale, and cost targets.
Step 3 ruleIdentify data and evaluation signals; explain label needs and freshness requirements.
Step 4 ruleStart with a baseline and state what would justify an upgrade.
Step 5 ruleDiscuss background versus request-time work, caches, model selection, and failure handling.
Steps 6 and 7Explain evaluation, safe updates, risks, and the cost estimate.
General
Test Your Knowledge
Check your understanding and reinforce the key concepts covered in this section with a short, targeted assessment.
9 Questions
~14 mins
Your progress is saved automatically

Reading Progress

0%


Vote for new content

On This Page

Seven Steps, In Order

Step 1: What Are We Designing?

Step 2: What Does Success Mean?

Step 3: What Data Do We Have?

Step 4: What Is the Simplest Model That Works?

Step 5: How Do We Serve It?

Step 6: How Does It Keep Working?

Step 7: What Breaks, and What Does It Cost?

In the Interview

TL;DR