The Scenario
An internal API endpoint (`GET /transactions`) returns millions of financial records. The current implementation uses standard OFFSET/LIMIT pagination, but queries for page 50,000 are timing out because the database has to scan and discard hundreds of thousands of rows.
The Brief
Design a cursor-based pagination strategy for the `/transactions` endpoint. Explain the API request/response schema changes required, how the client will interact with the cursor, and the database index implications.
Deliverables
- The updated API response schema showing the cursor meta-data (next_cursor, has_more, etc.)
- The SQL query structure (or ORM equivalent) demonstrating how the cursor is used in the `WHERE` clause
- An explanation of the performance benefits over OFFSET/LIMIT
Submission Guidance
Focus on the architectural shift. How do you handle sorting when using cursors? What happens if the cursor column (like timestamp) is not unique?
Submit Your Work
Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.