Skip to main content

Netflix

Feature 2: Rank Movies / Fetch Top Movies

Problem Statement

Let's say you're building another feature of an app like Netflix. Now, you need to build a criterion so the top movies from multiple categories will combine into a single list of top-rated movies. In order to scale, the content search is performed in a distributed fashion. Search results for each category are produced in separate lists. Each member of a given list is ranked by popularity, with 1 being most popular and popularity decreasing as the rank number increases.

Input

Output

Similar problem on LeetCode: Merge K Sorted Lists

Video Explanation