Paginate a Large List
Talk it through out loud with your AI coach.
The problem
- medium
- Pro
Your API endpoint for listing orders returns all two million orders at once and times out. Explain how you'd add pagination, comparing offset-based and cursor-based approaches, and which you'd pick.
What a strong answer covers
- How page-number pagination works and what it's good for.
- Where that approach slows down or skips and repeats items.
- How continuing from a marker works instead.
- Which approach fits orders, and the details that keep it reliable.
Common mistake: Treating the two styles as equivalent and missing how new orders arriving mid-read shift every page.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud