Pagination: offset vs cursor
?offset=200&limit=50 (or page=5). Trivial to implement, jump-to-page-N works, total counts easy. Degrades at depth (the DB scans and discards offset rows) and skips/duplicates items when rows are inserted or deleted mid-pagination.
?cursor=<opaque token> encoding the last-seen sort key (WHERE (created_at, id) < (...) ORDER BY ... LIMIT 50). Constant cost at any depth, stable under concurrent writes. No random page access, requires a unique total ordering, cursors should be opaque (base64) so clients can't construct them.
Cursor for anything infinite-scroll, high-write, or large (feeds, logs, transaction lists) - it's the default for public APIs at scale (Stripe, Slack, GitHub's newer endpoints). Offset survives where humans need numbered pages over small, slow-changing sets (admin tables, search result pages). The interview sound bite: offset is O(offset) and unstable under writes; keyset is O(limit) and stable.