Freecine Video Recommendation Engine | System Design

Posted
29 Sept 2025
248 reads

Summary

I had a system design interview focused on building a video recommendation engine for Freecine, where I needed to outline the core logic, ranking strategies, and data structures.

How it went

During my system design interview, I was given the task to design and implement the core logic for a video recommendation engine, specifically for Freecine. The challenge was to create a system that could suggest videos based on user interactions, watch history, popularity, and individual preferences. I focused on defining how recommendations would be ranked, either by view frequency or relevance to user interests, utilizing a strategy pattern for flexible ranking logic. I also had to detail the key entities like VideoNode, Context, VideoEntry, and various RankStrategy types, along with their fields and methods, to ensure the engine could manage videos, fetch recommendations, and update usage statistics effectively.

Questions asked (1)

  1. 01

    Design Freecine Video Recommendation Engine

    System Design · Hard

    Problem Statement

    Design and implement the core logic for a video recommendation engine used in Freecine. The engine should suggest videos as the user interacts with the platform, based on previous watch history, popularity, and user preferences.

    Given a search query or recently watched video, the engine should return top recommended titles (e.g., related movies, trending series, or popular APK content).

    Recommendations should be ranked either by frequency of views or relevance to user interests. We will use the strategy pattern to allow ranking logic based on different strategies.

    Implementation Considerations

    • User Context: Each user has a history of watched videos, genres, and languages.
    • Recommendation Engine: Fetches related videos from the library.
    • Ranking Strategies: Based on frequency (most watched) or relevance (genre + language match).
    • Updating Usage: Each time a video is played, its view count should be updated in the system.

    Entities to Consider

    • VideoNode: Data structure to store videos & traverse by category/genre.
    • Context: Language (e.g., English, Portuguese, Spanish) + genre (Action, Anime, Drama).
    • VideoEntry: Metadata and details about each video.
    • EntityType (Enum): MOVIE, SERIES, ANIME, DOCUMENTARY, LIVE.
    • RankStrategy: rankVideos(List availableVideos, String query) (e.g., FrequencyBased, RelevanceBased).
    • RecommendationEngine (Facade class).

    Entity Fields & Methods

    • VideoNode
      • children
      • isEndOfVideo
      • viewCount
      • videoTitle
      • entityType
      • language
      • Methods: insertVideo(String videoTitle), findVideo(String videoTitle), getRecommendations(String prefix/query), deleteVideo()
    • VideoEntry
      • videoTitle
      • entryType
      • language
      • viewCount
    • RecommendationEngine
      • VideoNode
      • RankStrategy
      • currentLanguage
      • contextHistory
      • Methods: addVideo(), recommend(), recordView(), initializeLanguage()

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Freecine recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!