Blog.

I Wanted to Know How Netflix Knows Me — So I Built My Own Recommender

Yves DC

Sep 27, 2025

I Wanted to Know How Netflix Knows Me — So I Built My Own Recommender Image

The Curiosity

Every time I open Netflix, it feels like it already knows me. The same with YouTube — I tell myself I’ll only watch one video, and somehow I’m still scrolling an hour later. It’s not luck. It’s something happening behind the scenes.

As a developer, I couldn’t stop wondering: how do they do it? Is it AI? Some secret code that only big companies use? Or maybe just a trick to keep us hooked?

Instead of just guessing, I decided to try building my own mini recommendation system. Not a billion-dollar Netflix engine, but a tiny version that could at least give me a taste of how it works. And trust me — what I found was both exciting and frustrating at the same time.

If you’ve ever been curious about the “magic” behind recommendations, keep reading. I’ll walk you through the basics, show you what I built, and share the lessons I learned along the way.

The Basics of Recommendation Systems

Before I could build anything, I had to understand the basics. Luckily, recommendation systems usually fall into two main categories. Don’t worry — they sound scarier than they really are.

1. Content-based filtering

This one is simple: recommend things that are similar to what you already liked. Example: If you watched “Spider-Man,” the system might recommend “Iron Man,” because both are superhero movies. It doesn’t care about other users — it only looks at the content (movie genre, keywords, tags).

2. Collaborative filtering

This one is more social: recommend things that people like you enjoyed. Example: If Alice and I both like Spider-Man and Batman, but Alice also liked Superman, the system might recommend Superman to me too. It’s basically: “people who are similar to you also liked this.”

That’s it — at the core, recommendation systems are just matching patterns. Big companies use much more advanced versions, but the heart of it is still either:

  • “Here’s something similar,” or

  • “Here’s what people like you enjoyed.”

Once I understood this, I thought:

“Okay, maybe I don’t need AI superpowers to test this. Maybe I can actually try building my own baby version.”

How Big Platforms Do It (Simplified)

Now that I understood the basics, I started looking at how the big players do it — Netflix, YouTube, Amazon. And wow… it’s both impressive and terrifying at the same time.

Netflix:

  • They track everything you do — what you watch, when you pause, how long you watch.

  • They build a massive user × movie matrix and feed it into machine learning models.

  • The result? Almost every recommendation feels personal, like they peeked into my brain.

YouTube:

  • They combine watch history, likes/dislikes, time spent on videos, and even trending content.

  • Their system is real-time, meaning recommendations can change within minutes.

  • Basically, it’s a mix of collaborative filtering, content-based filtering, and trending algorithms all at once.

Amazon:

  • You’ve probably seen “Customers who bought this also bought…” — that’s collaborative filtering in action.

  • They track purchasing behavior, clicks, and even abandoned carts.

  • Every tiny action feeds into the recommendation engine.

The takeaway? Big platforms don’t rely on a single algorithm — they mix multiple approaches and layer on tons of data. For a solo developer like me, that felt overwhelming… but also motivating.

**I thought to myself: **

“Okay, I may not have Netflix’s data or ML models, but maybe I can make a tiny, simple version to understand the logic.”

My DIY Attempt (Building a Baby Recommender)

After seeing how Netflix and YouTube do it, I realized: I don’t need billions of users or a supercomputer to experiment. I just needed a small dataset and some basic logic.

Here’s what I did:

Step 1: Pick a dataset

I grabbed a small list of movies and had a few “users” rate them from 1–5.

Example table:

User Spider-Man Batman Superman Iron Man Alice 5 4 3 2 Bob 5 4 2 3 Me 4 5 1 2

Step 2: Compare users

I used a simple math trick called cosine similarity to see how similar users are to each other.

Basically: users who rate movies similarly are considered “similar.”

Step 3: Recommend items

Once I found users similar to me, I suggested movies they liked that I hadn’t seen yet.

TypeScript Code Snippet:

type Ratings = Record<string, number[]>;

const users: string[] = ['Alice', 'Bob', 'Me'];
const ratings: Ratings = {
  'Alice': [5, 4, 3, 2],
  'Bob': [5, 4, 2, 3],
  'Me': [4, 5, 1, 2]
};

// Cosine similarity function
function cosineSim(a: number[], b: number[]): number {
  const dot = a.reduce((sum, val, i) => sum + val * b[i], 0);
  const magA = Math.sqrt(a.reduce((sum, val) => sum + val * val, 0));
  const magB = Math.sqrt(b.reduce((sum, val) => sum + val * val, 0));
  return dot / (magA * magB);
}

// Compute similarity between 'Me' and others
users.forEach(user => {
  if (user !== 'Me') {
    const sim = cosineSim(ratings['Me'], ratings[user]);
    console.log(`Similarity between Me and ${user}: ${sim.toFixed(2)}`);
  }
});

Step 4: The “aha” moment

Even with just three users, the recommendations made sense.

It wasn’t perfect — some suggestions felt weird — but it worked.

**Diary moment: **

“I may not have Netflix’s algorithms, but I now understood the core logic. And that felt amazing.”

The Struggles Along the Way

Building my mini recommendation system was exciting, but it wasn’t all smooth sailing. I quickly ran into problems that Netflix and YouTube don’t make obvious.

1. The Cold Start Problem

**Problem: ** New users or new movies don’t have ratings yet.

Result: I couldn’t make meaningful recommendations for them.

Diary note:

“It felt like my system was blindfolded when a new user showed up.”

2. Tiny Dataset = Weird Suggestions

  • With only 3–5 users, similarity scores sometimes gave strange results.

  • Example: “Me” might get recommended a movie I actually disliked.

  • This taught me that recommendation systems need lots of data.

3. Scaling is Impossible (for me)

  • Even a few dozen users made the code slightly messy.

  • Big platforms have millions of users and items — I had to simplify everything.

  • Diary vibe: “I suddenly appreciated how much engineering goes into making recommendations feel ‘magic’.”

4. Accuracy vs Simplicity

I tried adding weights and tweaking the similarity formula in TypeScript:

// Adding simple weight to each movie
const weights: number[] = [1.5, 1, 1, 0.5]; // importance of each movie
function weightedCosineSim(a: number[], b: number[], w: number[]): number {
  const dot = a.reduce((sum, val, i) => sum + val * b[i] * w[i], 0);
  const magA = Math.sqrt(a.reduce((sum, val, i) => sum + val * val * w[i], 0));
  const magB = Math.sqrt(b.reduce((sum, val, i) => sum + val * val * w[i], 0));
  return dot / (magA * magB);
}

const simWeighted = weightedCosineSim(ratings['Me'], ratings['Alice'], weights);
console.log(`Weighted similarity between Me and Alice: ${simWeighted.toFixed(2)}`);

Even small tweaks made a noticeable difference, but it also made me overthink the system.

Diary Reflection:

These struggles reminded me that building even a “mini Netflix” isn’t trivial.

But facing these issues was part of the learning — I got a deeper understanding of the logic behind real recommendation engines.

Plus, it made me appreciate the engineering and data behind the apps I use every day.

What I Learned

After spending a few days building and tweaking my mini recommendation system, I realized that even a small experiment can teach a lot. Here’s what stuck with me:

1. You Don’t Need AI to Start

I was worried I needed machine learning or fancy algorithms.

Truth: a simple cosine similarity or nearest-neighbor approach can give meaningful recommendations.

Lesson: start small, understand the basics before trying complex solutions.

2. Data is Everything

Tiny datasets = weird recommendations.

The more users and ratings you have, the better your system works.

Even for blogs or small apps, collecting some interaction data is enough to make suggestions useful.

3. Hybrid Approaches Work Best

Big platforms mix content-based and collaborative filtering, plus trending signals.

Even in a small project, thinking about mixing multiple approaches makes your recommendations smarter.

4. Small Experiments Lead to Big Insights

I may not have built Netflix, but I understood the logic behind it.

I also learned about cold start problems, scaling challenges, and weighted recommendations.

Diary note: “It’s amazing how much you learn from building something even tiny.”

5. Actionable Idea for Your Own Projects

Even if you run a small blog or e-commerce site, you can implement a simple recommender in TypeScript.

For example: suggest posts to readers based on what similar readers liked.

<u>Small effort</u> = noticeable improvement in user engagement.

My Next Steps

Building my own mini recommendation system taught me more than I expected. I didn’t create Netflix, and I didn’t solve world-class AI problems. But I understood the logic behind something I used every day.

This little project reminded me that even small experiments can give big insights. I now see how data, simple math, and careful observation create the “magic” of personalized recommendations. And honestly, it’s exciting to think about applying this to my own projects — like suggesting blog posts to readers, or building a small product recommendation engine.

For now, my plan is:

Keep experimenting with small recommenders in TypeScript.

Document every lesson in my developer diary.

Mix these learnings with other experiments in coding, AI, and digital marketing.

If you’re curious and want to follow along, I’ll be sharing more experiments, breakdowns, and real-world coding diaries in my newsletter. You’ll get the insider view of what works, what fails, and what I actually build day by day.

“I may not be Netflix yet, but at least now I know how they do it — and that’s the first step to building something amazing myself.”

Blog.

Hello, We're content writer who is fascinated by content fashion, celebrity and lifestyle.
We helps clients bring the right content to the right people.

Newsletter

Join 10k+ subscribers!

By signing up, you agree to our Privacy Policy