Pagination strategy
For a mobile feed, would you paginate by offset or by cursor (keyset)? Justify it with the differences between the two.
For a mobile feed, would you paginate by offset or by cursor (keyset)? Justify it with the differences between the two.
Offset produces duplicates and gaps when items are inserted or deleted, and it gets expensive for the server. A cursor is anchored to the last item, so it's stable and costs a single index lookup. A mobile feed gets new posts inserted constantly, so pick cursor.
iOS system designMultiple choiceBasics
You're loading a feed with offset pagination. While the user is reading page 2, 3 new…
#pagination #cursor #offset
iOS system designShort answerExpert
Design the comment feed page for a community app. Constraints: comments are shown flat…
#pagination #cursor
iOS system designShort answerAdvanced
An iOS app implements infinite scroll for a photo feed seen by hundreds of millions of…
#pagination #cursor
CS fundamentals and algorithmsShort answerBasics
In an endless iOS list like a pin board, you want to stop the same item showing twice or…
#pagination #cursor