All jobs / Backend developer / API Development

Backend developer interview question · 1–3 years

The interviewer asks: “How do you paginate a list endpoint?” Strongest answer?

The strongest answer

A stable ORDER BY plus a limit. Keyset/cursor pagination (WHERE (created, id) < last) beats OFFSET for large pages. Always return a next cursor, not “page 7 of unknown.”

Why it works

Exactly. Unordered OFFSET is a dice roll. Cursors stay correct as rows insert, and they use the index instead of skipping N rows.

What a good answer covers

Answers that fall short

Who gets asked this

More API Development questions