← Questions

Deduplicate titles across a home page's visible rows

0
NetflixCodingLast asked Jul 2026

A home page shows rows (shelves) of titles, and only the first few titles of each row are visible on the first screen. The same title may appear in several rows. Choose what to display so no title appears twice in the visible area, filling each row's visible slots from its own list in order.

Pin the rules down with the interviewer first: what to do when a row runs out, whether earlier rows take priority, and how this changes as the user scrolls to show more of a row. Then discuss the data structures and the cost of rendering the first screen.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding