Design an Algorithm to Ensure No Duplicates in the First Netflix Home-Page Viewport
Context
You are rendering a Netflix-style home page composed of multiple horizontal carousels ("rows/rails"). Each row has a ranked list of candidate shows from upstream recommendation sources. On initial render, a user sees the first R_visible rows and the first C tiles per row (the "first screen/viewport").
Requirement: The union of all tiles visible in the first viewport (R_visible × C) must have no duplicate shows (same title), even if rows are sourced independently. Duplicates off-screen are allowed.
Task
-
Design an algorithm and the data structures to render the first viewport with no duplicates across all visible rows and columns.
-
Describe where the logic runs (client vs. server), how it handles ranking, and runtime complexity.
-
Discuss trade-offs, fallbacks, and how you would communicate/iterate with cross-functional teams (recs, product, client, backend).