KatInterview

Design a Recommendation Engine with a Conversational Layer

Machine LearningModel answer
HardModel answerMachine Learningrecommendation systemsretrievalLLM

Last updated

Design a personalized recommender from scratch, then add a chatbot that surfaces and explains those recommendations without hallucinating unavailable items.

Scenario

You are joining a team that has no existing recommendation infrastructure. Users browse a catalog of items (think products, articles, or media — pick one and state your assumption). Your goal is to design the full recommendation stack from scratch, then extend it with a conversational interface that lets users ask questions like "What would you recommend for me today?" or "Why did you show me that item?"

Part 1 — Recommendation System

Design the end-to-end system:

  • How do you collect and represent user and item data when you are starting from zero?
  • What is your retrieval strategy, and how does it scale to millions of items?
  • How do you rank candidates once you have retrieved them?
  • How do you handle new users and new items (cold start)?
  • How do you evaluate the system offline and online?
  • What does the serving architecture look like, and what are your latency targets?

Part 2 — Conversational Interface

Extend the system with a chatbot that:

  • Answers natural-language questions about recommendations
  • Explains why a particular item was recommended
  • Respects exactly the same eligibility and ranking rules as the non-conversational system (e.g., out-of-stock items must not appear)
  • Does not invent or hallucinate items

Address how the chatbot retrieves live recommendations, maintains session context, handles ambiguous queries, and degrades gracefully when the recommender is unavailable.

What Is Expected

A structured verbal or written walkthrough. Cover data, modeling, serving architecture, latency and throughput, evaluation, monitoring, failure modes, and how you would iterate over time. Justify your choices and call out trade-offs explicitly. You do not need to write code, but precise component names, data formats, and numbers are expected where useful.

Clarifying Questions You Should Ask First

Before answering, state what assumptions you are making about:

  • The item domain, catalog size, and feedback signals available
  • Whether user interactions in the chat session should influence long-term preference models
  • Acceptable end-to-end latency for recommendations and for chatbot responses

Hints

Hint 1

Start by nailing down your feedback signal (explicit ratings vs. implicit clicks/dwell time) because it drives almost every downstream modeling choice — sparse explicit signals usually push you toward implicit collaborative filtering or two-tower models rather than matrix factorization.

Hint 2

Treat retrieval and ranking as two distinct problems with different latency budgets: ANN search over embeddings for retrieval (~10 ms), a feature-rich pointwise or listwise ranker for the top-K candidates (~50 ms). Don't conflate them.

Hint 3

The chatbot's hardest constraint is grounding: the LLM must only reference items that come back from a live recommender API call made at query time. Think of the LLM as a presentation layer, not a knowledge store, and enforce that with tool use / function calling rather than hoping the model behaves.