Skip to main content

Collections for API Designs

Collection endpoints return many items, so their design covers listing, filtering, sorting, searching and pagination, plus handling bulk and long-running operations. Cursor and offset pagination, the 202 Accepted pattern and batch requests all belong here, and they decide whether an API stays fast as data grows.

Stage: Practical Design · Part of the API Design roadmap · Last reviewed 19 November 2026

What to learn in Collections

Collections interview questions

Why is cursor pagination preferred over offset pagination for large feeds?

Offset pagination makes the database skip rows, which slows down on deep pages, and results can duplicate or vanish when rows are inserted between requests. A cursor encodes the position of the last item, giving stable, index-friendly pages even as data changes.

How should an API expose a long-running operation?

Accept the request, return 202 Accepted with a Location header pointing to a job or operation resource, and let clients poll it for state such as pending, running, succeeded or failed. When done, the job links to the result. Webhooks can notify clients instead of polling.

Where Collections fits in the API Design roadmap

Collections belongs to the Practical Design stage (intermediate level), which takes about 15 hours. Everyday decisions.

Back to the full API Design roadmap