Lesson 9 of 30
Offset pagination is simple and lets you jump to any page — until the underlying data shifts mid-scroll, at which point it has a real correctness bug, not just a rough edge.
13 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
What real capability does a team give up by choosing cursor-based pagination over offset-based?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
Pagination splits a large list into pages the client fetches incrementally, and there are two fundamentally different ways to say "give me the next page":
Infinite scroll is a UI pattern, not a pagination strategy in itself — it's the presentation layer (load more automatically as the user nears the bottom) built, in most real implementations, on top of cursor-based pagination underneath, precisely because a continuously-scrolling feed is exactly the case where the underlying data keeps changing while someone is mid-scroll.
A list shows A-F, newest first. Page 1 (offset 0, take 3) already returned A, B, C. Page 2 requests offset 3, take 3 — items D, E, F.
Picture a list of six items, newest first, where page 1 (offset 0, take 3) has already been fetched and shown. Before page 2 is requested, a new item gets inserted at the front. With offset pagination, the page-2 request still says "skip 3" — but since everything shifted by one, that request now returns an item already shown on page 1 (a duplicate) and never returns the item that should have been last on page 1 before the shift (a skip). This isn't a rare edge case in a feed or list that receives writes while being read — it's the expected behavior of offset pagination under exactly that condition. Cursor-based pagination sidesteps it entirely: a request for "everything after item C" still means the same thing regardless of what got inserted elsewhere, because it's anchored to C's identity, not a position.
"How would you paginate this list?" is a near-universal follow-up to any feed or list-heavy system design prompt, and the strongest answers explain the offset-vs-cursor choice as a correctness tradeoff tied to whether the dataset changes while being paged, not a generic "cursor is more modern" preference.