๐ข 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:
- What's the business goal? (revenue? engagement? retention?)
- Scale: how many users/products/requests per second?
- Latency: how many ms does the feed have to build in?
- What data and infrastructure already exist?
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).
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.