Large datasets need pagination. Each pattern has tradeoffs.
Offset pagination:
GET /posts?offset=20&limit=10
Simple but breaks if data changes (items shift).
Cursor pagination:
GET /posts?cursor=abc123&limit=10
Stable. Returns a cursor pointing to the next page.
Infinite scroll: Load more as user scrolls. Great for feeds.
Traditional pages: Numbered pages with navigation. Good for search results.
Interview tip: For feeds, prefer cursor pagination. For search results, offset pagination with page numbers is acceptable.