SpinTheMic
Pro

Interview practice question

Pagination returns duplicates

Backend Engineering · API Design · Intermediate

Users report seeing the same item on page 2 and page 3 of a list sorted by price. Why does this happen and how do you fix it?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Non-unique sort key = unstable order.
  • Ties shuffle between queries.
  • Add unique tiebreaker (id).
  • Cursor includes both fields.
  • Offset pagination with inserts also causes it.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics