intermediate · queries

Offset or Cursor?

You're adding pagination to a list endpoint. Offset or cursor pagination — how do you decide?

Practical scenario

GET /orders currently returns everything; the table just passed 2 million rows and support dashboards, mobile infinite scroll, and a nightly export all read it.

What it tests

  • • Whether the candidate asks about the access pattern before picking a mechanism
  • • Understanding of what concurrent writes do to offset pages
  • • Awareness of the database cost behind each promise