Bird
0
0

A developer wrote this URL for pagination: /api/users?page=0&limit=20. Why might this cause a problem?

medium📝 Debug Q14 of 15
Rest API - Pagination Patterns
A developer wrote this URL for pagination: /api/users?page=0&limit=20. Why might this cause a problem?
APage numbers usually start at 1, so page=0 may return no data or error.
BLimit cannot be 20, it must be less than 10.
CThe URL is missing the sort parameter.
DPage=0 means the last page, which is invalid.
Step-by-Step Solution
Solution:
  1. Step 1: Understand pagination page numbering

    Most APIs start page numbering at 1, so page=0 is invalid or returns empty.
  2. Step 2: Check other options

    Limit=20 is valid, missing sort is unrelated, page=0 is not last page.
  3. Final Answer:

    Page numbers usually start at 1, so page=0 may return no data or error. -> Option A
  4. Quick Check:

    Page numbering starts at 1 [OK]
Quick Trick: Page usually starts at 1, not 0 [OK]
Common Mistakes:
  • Assuming page=0 is valid
  • Thinking limit must be less than 10
  • Confusing page=0 with last page

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes