← Questions
Deduplicate titles across a home page's visible rows
0
I was asked this
No reports yet. Sign in to say where you were asked it.
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.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
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
