MODULE 18 ยท Middle ยท 2.5 hours

What separates a mid-level engineer is designing the whole system

A one-sentence brief, exactly as it arrives at an interview. We unpack it with a framework: from the business metric to architecture, constraints and risks.

Open this module in the simulator All 23 lessons

The first two modules are free, no card. The rest are $20/month.

๐Ÿข The situation

Lena calls you into the meeting room:

"You've been on the team a year and a half โ€” time to think like a middle. What separates a middle from a junior is not algorithm knowledge, but the ability to design a whole system: from the business metric to the architecture and the risks. Practice run: Victor wants a 'smart product feed' in the mobile app. Here's your one-sentence brief โ€” just like in an interview. Decompose it with the framework; I'll play the mean interviewer."

๐ŸŽฏ Your task

Master the 7-step ML system design framework and apply it to the "smart feed".


๐Ÿ“š Theory: the 7-step framework

1. Clarify the requirements (never skip!)

The questions a junior doesn't ask and a middle always does:

2. Translate the business metric into ML metrics

The chain: business metric (revenue per session) โ†’ online proxy metrics (CTR, add-to-cart rate) โ†’ offline model metrics (NDCG@k, recall@k). Know where the chain can break: CTR grows on clickbait while revenue doesn't.

3. Data

Sources, volume, labeling, freshness. Also here: cold start, feedback loops, privacy.

4. The model: from simple to complex

Always walk the ladder: rules/top โ†’ simple model โ†’ complex. The two-stage architecture for recommendations: retrieval (hundreds of candidates out of millions, a light model/ANN index) โ†’ ranking (a heavy model precisely sorts the candidates).

Retrieval โ†’ Ranking: the funnel within 150 ms Catalog 300,000 products RETRIEVAL embeddings + ANN (FAISS) ~10 ms RANKING boosting on features user ร— item ร— context ~30 ms Feed + business rules 300k 500 20 a light model picks candidates out of millions; a heavy one precisely sorts hundreds fallback: on any stage timeout serve the cached top โ€” the feed never goes down
The standard for high-load recommendations: the completeness/speed trade-off is managed at every stage of the funnel.

5. The training pipeline and features

How the train set is built, how features are computed, where the feature store lives (the same features for training and inference โ€” otherwise training/serving skew!), how often retraining happens.

6. Serving and infrastructure

Online (real-time API) vs offline (nightly recompute, serve from cache)? Latency/cost/freshness. Fallbacks for model failure.

7. Evaluation, rollout, monitoring

Offline evaluation โ†’ A/B test โ†’ gradual rollout (canary). Monitoring of quality, drift, business metrics; a rollback plan.


What to remember

  • System design starts with questions, not architecture.
  • The metric chain: business โ†’ online proxies โ†’ offline; guardrails are mandatory.
  • The retrieval โ†’ ranking two-stage design is the high-load recommendation standard.
  • A feature store fights training/serving skew; a fallback for every component.

Next in this module: Practice: applying it to the "smart feed"

A step-by-step walkthrough of the solution, the code and a five-question quiz.

Open the module โ†’

Nearby lessons

17 Defects on the conveyor: computer vision 19 The model is ready. Now โ€” to production

The whole program โ€” 23 lessons