Grokking the Modern Frontend System Design Interview
Vote

0% completed

​

Exercise: Merge Pages Without Duplicates

Pagination with Offsets and Cursors showed how an offset page can repeat a product. A new yogurt was added at the top of the list, every product moved down one place, and Oat milk appeared at the end of page 1 and again at the start of page 2. A list that appends each new page as it arrives should therefore drop any product it already shows.

The Task

Write mergePages(pages), which joins the pages into one list of product ids.

  • `pages

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content