Bird
0
0

Given a list of 50 items numbered 1 to 50, what items will be returned by the API call GET /data?offset=10&limit=5?

medium📝 Predict Output Q4 of 15
Rest API - Pagination Patterns
Given a list of 50 items numbered 1 to 50, what items will be returned by the API call GET /data?offset=10&limit=5?
AItems 11 to 15
BItems 10 to 14
CItems 5 to 9
DItems 15 to 20
Step-by-Step Solution
Solution:
  1. Step 1: Understand offset and limit meaning

    Offset 10 means start from the 11th item (indexing from 0), limit 5 means return 5 items.
  2. Step 2: Calculate the range of items returned

    Items returned are 11,12,13,14,15 (5 items starting at 11).
  3. Final Answer:

    Items 11 to 15 -> Option A
  4. Quick Check:

    offset 10 + limit 5 = items 11-15 [OK]
Quick Trick: Offset is zero-based start index [OK]
Common Mistakes:
  • Counting offset as 1-based
  • Returning wrong range of items
  • Confusing offset with page number

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes