Daily iOS
CS fundamentals and algorithms

Infinite scroll cursors

In an endless iOS list like a pin board, you want to stop the same item showing twice or the next page going missing. If you use a cursor instead of an offset, what state would you store alongside it?

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

Store the server's opaque cursor from the last successful response, bundled with hasMore, the in-flight request, and a key identifying which feed (sort, filter) it belongs to, so you never request the same cursor twice or reuse another feed's cursor.

Share a question