Bird
0
0

You have this API call: GET /users?offset=20&limit=10. The API returns an empty list even though there are 25 users total. What is the likely problem?

medium📝 Debug Q14 of 15
Rest API - Pagination Patterns
You have this API call: GET /users?offset=20&limit=10. The API returns an empty list even though there are 25 users total. What is the likely problem?
AOffset is too large, skipping all remaining users
BLimit is too small to return any users
COffset and limit parameters are swapped
DAPI does not support offset-based pagination
Step-by-Step Solution
Solution:
  1. Step 1: Calculate remaining items after offset

    Offset 20 skips first 20 users; only 5 users remain (25 - 20 = 5).
  2. Step 2: Understand why empty list is returned

    API returns empty list likely because it expects at least 10 items (limit), but only 5 remain; some APIs may return empty if offset exceeds total count.
  3. Final Answer:

    Offset is too large, skipping all remaining users -> Option A
  4. Quick Check:

    Offset > total users - limit causes empty results [OK]
Quick Trick: Check if offset skips beyond total items [OK]
Common Mistakes:
  • Assuming limit controls start position
  • Swapping offset and limit values
  • Ignoring total item count in pagination

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes