Why your feed shows you the same five posts twice
transcript
Next page of your feed. The first five posts? You just read them. Not a glitch. It's how the app counts pages.
You're reading page 1. Twenty posts, newest first. Meanwhile, five new posts arrive at the top. You ask for page 2. Skip the first 20, take the next 20. But everything shifted down by five. You see five posts again.
Here's why. An offset counts from the top. And in a feed, the top never stops moving.
Page equals 2 counts items from the top. New posts shift it. A cursor remembers where you stopped: the last post's timestamp and ID. Page 2 becomes: posts older than this one. However many posts land above you, that never moves. No repeats.
The interviewer pushes: page equals 3 is simpler. Why a cursor? Your answer: feeds move. A position survives that. An offset doesn't.
So for anything that moves, paginate by position. Not by count. Cursors, not offsets.
Full breakdown in the lecture.