AI from scratch

Module 08 · System Design & Interviews

Design the system — then defend it

A repeatable framework for ML / GenAI design rounds, worked examples, and how to use this curriculum in interviews without sounding like a textbook.

The 6-box design framework

Use this every time. Aim for a structured 20–30 minute whiteboard:

1. Requirements   users, SLA, latency, cost, languages, compliance
2. Data           sources, labels, privacy, freshness, access control
3. Model/prompt   baseline → candidates → why this choice
4. Eval           offline metrics, golden sets, human review
5. Serve          batch vs online, API shape, rollouts
6. Monitor        drift, quality, feedback, retrain / reindex triggers

State assumptions out loud. Ask clarifying questions before diving into architecture — seniors listen for that.

Example: RAG customer-support bot

Example: fraud scoring service

This is the system design behind FraudWatch.

Prompt vs RAG vs fine-tune

Need fresh / private / citable facts?     → RAG (+ tools)
Need style / format / tool-calling habit? → fine-tune (or strong few-shot)
Need a quick behaviour tweak?             → prompt change + eval
Unsure?                                   → prompt + RAG first; fine-tune when metrics plateau

Strong answers compare options explicitly — cost, latency, data needs, ownership — instead of picking one blindly.

Practice prompts

Sketch each with the 6-box framework (also in the interview bank):

Interview strategy

You now have the full arc: foundations → algorithms → deep learning → transformers → GenAI → data → MLOps → design. The remaining work is reps: projects, evals, and whiteboard practice.

Interview questions

Design a RAG customer-support bot for a SaaS product.

Clarify SLA/languages/escalation. Ingest→chunk→embed→retrieve→generate with citations; eval on real tickets; guardrails for PII; monitor deflection, CSAT, hallucinations; version prompts and indexes.

Fine-tune, prompt, or RAG for a domain copilot?

Default prompt + tools + RAG for facts. Fine-tune for stable style/tool use. Compare data availability, change frequency, privacy, and cost explicitly.

Design semantic search over internal documents.

ACLs first. Hybrid search, sensible chunking, re-ranker, freshness pipeline, relevance eval (nDCG / labels), latency and permission checks at query time.

How would you present FraudWatch in a design interview?

Walk the 6 boxes: imbalance & cost matrix, stratified/time splits, PR-AUC + threshold, API with versioned artifacts, monitoring score drift and queue load.