Bird
0
0

What will be the result of a request with limit=15 and offset=45 on a list of 50 items?

medium📝 Predict Output Q5 of 15
Rest API - Query Parameters and Filtering

What will be the result of a request with limit=15 and offset=45 on a list of 50 items?

AItems 45 to 59
BItems 1 to 15
CItems 45 to 60
DItems 46 to 50
Step-by-Step Solution
Solution:
  1. Step 1: Calculate starting item

    Offset 45 means start from item 46 (zero-based index).
  2. Step 2: Check list length limit

    Only 5 items remain from 46 to 50, so only these are returned despite limit 15.
  3. Final Answer:

    Items 46 to 50 -> Option D
  4. Quick Check:

    Offset 45 + Limit 15 but only 5 items left [OK]
Quick Trick: Limit can be bigger than remaining items, returns only available [OK]
Common Mistakes:
  • Expecting 15 items even if list is shorter
  • Starting at item 45 instead of 46
  • Ignoring list length when applying limit

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes