Lesson 11.4advanced4 h

ML and LLM system design and interviews

A framework, two worked cases and the question families you will meet

Most ML and AI engineering roles are won in two rounds: a system-design conversation where you reason from requirements to monitoring, and technical rounds that probe fundamentals (3.5 Evaluating models: metrics, validation and the bias–variance trade-off, 4.4 Backpropagation, fully derived, 7.2 Scaled dot-product and multi-head attention, fully derived) and LLM engineering (9.9 Production: latency, cost, caching, guardrails, security and privacy, 10.10 Agent safety and security). The same framework you use to pass those rounds is the one you should use to design real systems, so this lesson teaches both at once.

You'll be able to

  • Apply a six-step framework (requirements → data → model → serving → evaluation → monitoring) to any ML or LLM product
  • Design a two-stage recommendation or search system and an LLM assistant with RAG, with explicit trade-offs
  • Recognize the five interview question families and prepare for each with a plan
  • Communicate designs with clarifying questions, numbers and stated assumptions

Key ideas

  1. Six steps, said aloud: requirements → data → model → serving → evaluation → monitoring.
  2. Turn goals into numbers (latency percentiles, cost per request, target metric) before proposing a model.
  3. Recommendation and search use two stages: cheap candidate generation (two-tower embeddings + ANN) and a richer ranker; evaluate with recall@k, nDCG and time-split A/B tests.
Show 4 more key ideas
  1. An LLM assistant with RAG needs hybrid retrieval + reranking, a cited grounded prompt with a refusal path, tool calls for actions, and access control enforced in the store.
  2. Evaluate LLM systems with a golden set, a judge calibrated against humans and an adversarial injection set; monitor refusal rate, judge scores and cost.
  3. Five question families: fundamentals, coding, ML system design, LLM engineering, behavioral; prepare each from your own projects.
  4. Always start from a baseline and say what evidence would justify each upgrade; finish with evaluation and monitoring.

Suggested path through this lesson