KatInterview

End-to-End Personalized Ranking System: From Logs to Live Serving

Machine LearningModel answer
HardModel answerMachine Learningrecommendation systemsfeature storestwo-tower model

Last updated

Design a full recommendation pipeline covering data ingestion, feature engineering, model training and refresh, multi-stage serving architecture, and production reliability.

Context

You are a senior ML engineer at a large e-commerce platform. Leadership wants a "Picks for you" widget on the homepage that surfaces a personalized list of products for every visit.

Your task is to design the full machine learning system that powers it — not just the model, but everything from how you collect training data to how you serve results under tight latency constraints.

What to Cover

Walk through each of the following layers and explain the key decisions at each one:

  1. Scope and assumptions — What are you optimizing for? What scale do you need to handle? What latency budget does the widget get?
  2. Data collection and labeling — Which events do you log, and how do you turn raw events into training examples?
  3. Feature pipeline — What features matter most, how are they computed, and how do you keep offline training features consistent with what the model sees at serving time?
  4. Model architecture and training — What kind of model or models would you use, and why? How do you handle the fact that you have hundreds of millions of items?
  5. Model refresh cadence — How often should different parts of the system be updated, and what gates a refresh before it goes live?
  6. Online serving path — Walk through a single request from API call to returned list, including each stage's role and its share of the latency budget.
  7. Reliability and fallbacks — What happens when a component is slow or unavailable?
  8. Experimentation and validation — How do you know a new model is actually better?

What a Strong Answer Looks Like

  • States assumptions about scale and objectives up front, then ties design decisions back to those numbers.
  • Identifies the core tension (you cannot score 500 million items in under 100 ms) and shows how the architecture resolves it.
  • Discusses feedback loops, position bias, and cold start as first-class concerns, not afterthoughts.
  • Explains trade-offs rather than just naming technologies.
  • Covers what can go wrong in production and how you defend against it.

Hints

Hint 1

The catalog is far too large to score every item per request. What multi-stage structure lets you narrow down candidates progressively while staying within latency limits?

Hint 2

Your training data comes from what the model previously chose to show. Think about what that does to the distribution of labels over time and how you might correct for it.

Hint 3

Offline metrics like AUC and NDCG can improve while online business metrics stay flat or get worse. What does that tell you about how to gate a model release?