Daily iOS
iOS system design

Large-scale photo feed pagination

An iOS app implements infinite scroll for a photo feed seen by hundreds of millions of users. How would you design the page key so duplicates and gaps stay low even when the server's ranking changes?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

The page key is an opaque cursor the server issues, encoding a ranking snapshot id and the last item's sort value rather than an offset. The client keeps one per feed kind, and dedups by the photo ids in the response when merging, so pages still join up even after the ranking has changed.

Share a question