What are the considerations for pagination in a REST API?
- Always return limited results (avoid huge payloads).
- Provide page and limit parameters → /users?page=2&limit=20.
- Return metadata → { "page": 2, "totalPages": 10 }.
- Support cursor-based pagination for large datasets.
🔹 Advanced REST API Design – Interview Q&A