Bird
0
0

Given a list of 50 items numbered 1 to 50, what will be the output of an API call with limit=10 and offset=40?

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

Given a list of 50 items numbered 1 to 50, what will be the output of an API call with limit=10 and offset=40?

A[50]
B[41, 42, 43, 44, 45, 46, 47, 48, 49, 50]
C[40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
D[]
Step-by-Step Solution
Solution:
  1. Step 1: Calculate starting item

    Offset 40 means start from item number 41 (zero-based index).
  2. Step 2: Apply limit to get 10 items

    From item 41, next 10 items are 41 to 50.
  3. Final Answer:

    [41, 42, 43, 44, 45, 46, 47, 48, 49, 50] -> Option B
  4. Quick Check:

    Offset 40 + Limit 10 = Items 41-50 [OK]
Quick Trick: Offset 40 means start at item 41 (zero-based) [OK]
Common Mistakes:
MISTAKES
  • Starting at item 40 instead of 41
  • Returning fewer items than limit without reason
  • Confusing zero-based offset with one-based

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes