Have you ever opened Netflix with absolutely no idea what to watch, only to find something interesting within a few seconds?
That's not accidental.
Behind that experience is a sophisticated recommendation system designed to answer one fundamental question:
What content should we show this user right now to maximize the probability that they will watch it?
This question makes recommendation systems one of the most interesting problems in Machine Learning System Design.
It's also a great interview problem because solving it requires much more than selecting an ML algorithm.
You need to think about data, user behavior, candidate generation, ranking, embeddings, feedback loops, scalability, latency, experimentation, and business objectives.
Let's break it down.
1. Defining the Problem ๐ฏ
Suppose you're given this ML system design question:
Design a Netflix-style movie and TV-show recommendation system.
A naive interpretation might be:
Recommend movies that the user will like.
But "like" is difficult to define.
Does liking something mean:
- Clicking it?
- Watching 5 minutes?
- Watching 50%?
- Completing it?
- Watching another episode?
- Giving it a positive rating?
Instead, we can formulate the objective as:
Rank available content according to the probability that the user will engage with or watch it.
Now we have something measurable.
The recommendation problem becomes a ranking problem.
Given a user:
U
and thousands of potential pieces of content:
Mโ, Mโ, Mโ ... Mโ
we want our ML model to estimate something like:
P(Watch | User, Content, Context)
Then rank the candidates according to their predicted relevance.
2. Why Trending Content Isn't Enough ๐
Imagine building the simplest possible recommendation engine.
We could take the 20 most popular shows and display them to everyone.
Something like:
User opens application
โ
Find trending content
โ
Sort by popularity
โ
Display Top 20
This would work reasonably well initially.
But there's one major problem:
Every user gets nearly the same recommendations.
Consider two users.
User A
Mostly watches:
Science Fiction
Thrillers
Technology
Mystery
User B
Mostly watches:
Romance
Comedy
Drama
Family
Showing identical recommendations to both users wastes valuable information about their preferences.
That's where personalization becomes important.
3. Why Viewing History Alone Isn't Enough
Let's improve our system.
Suppose someone frequently watches science-fiction movies.
Our recommendation engine could simply recommend:
More science-fiction movies.
Better.
But there's another problem.
The recommendation system can become trapped inside the user's historical preferences.
This creates what we might call a recommendation bubble.
The user keeps seeing:
Sci-Fi
Sci-Fi
Sci-Fi
Sci-Fi
Sci-Fi
But maybe they would absolutely love a psychological thriller.
They simply haven't discovered one yet.
A strong recommendation system therefore needs to balance two concepts:
Exploitation
Recommend things we're already confident the user will enjoy.
and
Exploration
Introduce potentially interesting content outside their obvious historical preferences.
This is an important concept when designing recommendation systems.
4. Collaborative Filtering ๐ค
One way to discover these hidden interests is through collaborative filtering.
Imagine the following situation.
User A watched:
Stranger Things
Dark
Black Mirror
User B watched:
Stranger Things
Dark
Black Mirror
Mindhunter
Their viewing patterns overlap significantly.
Therefore, the system might infer:
If User B enjoyed Mindhunter, there's a reasonable chance User A might enjoy it too.
Notice something interesting here.
The recommendation isn't necessarily based on the genre.
It's based on behavioral similarity between users.
At scale, these relationships become extremely powerful.
Millions of users create patterns such as:
Users โ Content โ Interactions
Machine learning models can discover relationships inside those interactions that humans would struggle to define manually.
5. Implicit Feedback vs Explicit Feedback ๐ง
Recommendation systems can learn from two major types of feedback.
Explicit Feedback
The user intentionally tells us their preference.
Examples:
โญโญโญโญโญ rating
๐ Like
๐ Dislike
This information is extremely useful.
But there's a problem.
Most users don't rate everything they watch.
That's why modern recommendation systems rely heavily on implicit feedback.
Implicit feedback comes from observing behavior.
Examples include:
Movie clicked
Watch duration
Completion percentage
Episode completion
Rewatch behavior
Browsing history
Search behavior
Skip behavior
Time spent browsing
Imagine two users.
User A gives a movie:
โญโญโญโญโญ
User B watches the entire movie twice.
Which signal demonstrates stronger engagement?
Potentially User B.
That's why behavioral data becomes incredibly valuable.
6. Feature Engineering ๐ง
Once we collect interaction data, we need to transform it into meaningful features.
We can broadly divide features into three categories.
User Features
Examples:
Viewing history
Preferred genres
Average watch duration
Completion rate
Language preference
Recent interactions
Historical engagement
Content Features
Examples:
Genre
Actors
Director
Release year
Language
Popularity
Runtime
Content maturity rating
Contextual Features
Context is often overlooked.
The same person might behave differently depending on the situation.
Examples:
Time of day
Day of week
Device
Session history
Recent searches
Recent watches
For example, a person's preferences on:
Friday at 10 PM
might be very different from:
Monday at 7 AM.
Context matters.
7. Candidate Generation โก
Now we reach an important scalability problem.
Imagine the catalog contains:
100,000+ movies and shows
Ranking every piece of content using an expensive ML model every time someone opens the application would be inefficient.
Instead, recommendation systems usually introduce a candidate-generation stage.
The objective is simple:
Reduce thousands of possible recommendations into a smaller collection of promising candidates.
Conceptually:
100,000 Content Items
โ
Candidate Generation
โ
500 Candidates
โ
Ranking Model
โ
50 Candidates
โ
Filtering + Re-ranking
โ
Final Recommendations
This dramatically reduces computation.
8. Where Embeddings Enter the Picture ๐ข
Modern recommendation systems frequently represent users and content using embeddings.
Instead of representing a movie using thousands of manually created rules, we can represent it as a vector.
Conceptually:
Movie A
[0.12, 0.81, 0.34, 0.72, ...]
Users can also have embeddings:
User A
[0.15, 0.79, 0.31, 0.69, ...]
Now recommendations can involve finding content vectors that are close to the user's preference vector.
Conceptually:
User Embedding
โ
Vector Similarity Search
โ
Similar Content Embeddings
โ
Candidate Movies
Approximate Nearest Neighbor techniques can make this retrieval efficient even with very large catalogs.
9. Ranking the Candidates ๐
Candidate generation answers:
What could this user potentially enjoy?
Ranking answers:
Which of those candidates should appear first?
Suppose candidate generation produces:
500 movies
A ranking model evaluates those candidates using user, content, and contextual signals.
Conceptually, we want:
Score = Model(User, Movie, Context)
Producing something like:
Movie A โ 0.94
Movie B โ 0.89
Movie C โ 0.84
Movie D โ 0.76
Higher scores represent stronger predicted relevance or engagement according to the objective we've chosen.
The highest-ranking candidates become recommendations.
10. Filtering and Re-Ranking ๐ฆ
Ranking alone still isn't enough.
Imagine the model produces:
Movie 1 โ Action
Movie 2 โ Action
Movie 3 โ Action
Movie 4 โ Action
Movie 5 โ Action
Technically, these recommendations could all have excellent prediction scores.
But the experience isn't necessarily good.
Therefore, another layer can introduce constraints such as:
Diversity
Freshness
Content availability
Previously watched content
Regional availability
Age restrictions
Business rules
The final recommendation list becomes both relevant and useful.
11. High-Level Architecture ๐๏ธ
Putting everything together, our Netflix-style recommendation pipeline might look like:
User Interactions
โ
Data Collection Layer
โ
Feature Pipeline
โ
User / Content Embeddings
โ
Candidate Generation
โ
Ranking Model
โ
Filtering + Re-ranking
โ
Personalized Recommendations
โ
User Interaction
โ
Feedback Loop
โบ
Notice the loop.
Every interaction generates new information.
That information can improve future recommendations.
This creates a continuous ML feedback loop.
12. Measuring Whether It Works ๐
Building the model isn't enough.
We need metrics.
Offline ML metrics might include:
Precision@K
Recall@K
NDCG
Mean Reciprocal Rank
But production recommendation systems should also care about business and behavioral metrics.
For example:
Watch Time
Recommendation CTR
Completion Rate
Session Duration
Retention
Content Discovery
Ultimately, the recommendation system should improve the user's experienceโnot simply maximize an offline ML score.
13. Online Experimentation ๐งช
Suppose we create a new ranking model.
The existing model produces:
CTR = 7.2%
Our offline experiments suggest the new model is better.
Should we immediately replace the production model?
No.
We can perform an A/B test.
For example:
Group A
โ
Existing Recommendation Model
Group B
โ
New Recommendation Model
Then compare metrics such as:
CTR
Watch Time
Completion Rate
Retention
If Group B consistently performs better without damaging other important metrics, the new model can gradually be rolled out.
14. The Bigger Engineering Lesson ๐ก
The most important lesson from this problem isn't collaborative filtering.
It isn't embeddings.
And it isn't ranking models.
It's this:
Machine Learning System Design starts with defining what we're actually optimizing.
Before choosing an algorithm, ask:
What problem are we solving?
What does success mean?
What signals do we have?
What data should we collect?
What constraints exist?
How will predictions be served?
How will we measure success?
How will the system learn from feedback?
Only after answering these questions should we start discussing models.
Final Architecture
Our simplified architecture becomes:
User Behavior
โ
Data Collection
โ
Feature Engineering
โ
User + Content Embeddings
โ
Candidate Generation
โ
Ranking
โ
Filtering
โ
Diversity / Exploration
โ
Recommendations
โ
A/B Testing
โ
Feedback Loop
And that's the foundation of a scalable recommendation platform.
The same architecture isn't limited to movies.
Similar principles can power recommendations across:
๐ E-commerce products
๐ต Music
๐ฐ News
๐ฑ Social-media feeds
๐ผ Jobs
๐ฎ Games
๐ Books
๐ Food delivery
The content changes.
The underlying ML System Design principles remain remarkably similar.
Key Takeaway
If an interviewer asks:
"How would you design Netflix's recommendation system?"
Don't immediately answer:
"I'll use collaborative filtering."
Start with:
"First, let's define what behavior we're trying to predict and what business outcome we're optimizing."
That single distinction changes the conversation from discussing an ML algorithm to designing an ML system.
And that's the mindset required when moving from:
Software Engineer โ ML Engineer โ AI/ML Architect. ๐
If you're interested in Machine Learning System Design, Recommendation Systems, RAG, Agentic AI, LLM Architecture, and AI System Design, follow along.
I'll be breaking these systems down one architecture at a time. ๐

Top comments (0)