Bird
Raised Fist0

If an API returns 8 items for GET /users?offset=20&limit=10 but the total users are 28, what does this indicate?

medium📝 Predict Output Q5 of Q15
Rest API - Pagination Patterns
If an API returns 8 items for GET /users?offset=20&limit=10 but the total users are 28, what does this indicate?
AThe last page has fewer items than the limit
BThe API ignored the offset parameter
CThe limit parameter was set incorrectly
DThere are more than 30 users in total
Step-by-Step Solution
Solution:
  1. Step 1: Calculate expected items from offset and limit

    Offset 20 means start at user 21, limit 10 means up to 10 items, but only 28 users total.
  2. Step 2: Understand why only 8 items are returned

    From user 21 to 28 is 8 users, so the last page has fewer items than the limit.
  3. Final Answer:

    The last page has fewer items than the limit -> Option A
  4. Quick Check:

    Last page often has fewer items [OK]
Quick Trick: Last page may have fewer items than limit [OK]
Common Mistakes:
MISTAKES
  • Assuming API ignored offset
  • Thinking limit is ignored
  • Assuming more users than total

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes