KatInterview

Build a Content-Based Movie Recommender from Scratch

Machine LearningModel answer
EasyModel answerMachine Learningmachine learningrecommendation systemscontent-based filtering

Last updated

Design and evaluate a simple content-based filtering system that recommends movies to a new user who has rated only a handful of films.

Scenario

You are a junior ML engineer at a streaming platform. The product team wants a recommendation module for brand-new users who have rated fewer than five movies. Collaborative filtering is not viable yet because there is not enough user-interaction data (the classic cold-start problem).

Your manager asks you to prototype a content-based filtering approach using only movie metadata that the platform already has:

  • Genre tags (e.g., Action, Drama, Sci-Fi) — multi-label
  • Average critic score (0–100)
  • Release decade
  • Runtime in minutes
  • Director name

What you are expected to cover

  1. Problem framing — what exactly are you predicting or ranking?
  2. Feature engineering — how do you turn the metadata above into a usable item representation?
  3. User profile construction — given a few rated movies, how do you represent the user?
  4. Scoring and ranking — how do you produce a ranked list of recommendations?
  5. Evaluation — how do you measure whether your system is any good, offline and online?
  6. Limitations and next steps — what does this approach get wrong, and what would you do with more data?

You do not need to write production code, but pseudo-code or concrete math notation is encouraged where it clarifies your design.

Hints

Hint 1

Think about how to represent a movie as a single numeric vector — which fields need encoding and which can be used directly?

Hint 2

The user profile can be as simple as an average of the item vectors for movies the user rated positively — what weighting scheme could make this smarter?

Hint 3

Offline evaluation is tricky when you only have a handful of ratings per user — consider what metrics still make sense at very small k values.