Bird
0
0

An API supports pagination with limit and offset. You want to fetch all 75 items in batches of 25. How many requests do you need and what are the offset values?

hard📝 Application Q9 of 15
Rest API - Query Parameters and Filtering

An API supports pagination with limit and offset. You want to fetch all 75 items in batches of 25. How many requests do you need and what are the offset values?

A2 requests with offsets 0, 25
B3 requests with offsets 0, 25, 50
C4 requests with offsets 0, 25, 50, 75
D3 requests with offsets 1, 26, 51
Step-by-Step Solution
Solution:
  1. Step 1: Calculate number of requests

    75 items / 25 per request = 3 requests needed.
  2. Step 2: Determine offset values

    Offsets start at 0, then 25, then 50 for each batch.
  3. Final Answer:

    3 requests with offsets 0, 25, 50 -> Option B
  4. Quick Check:

    75/25=3 requests; offsets 0,25,50 [OK]
Quick Trick: Divide total by limit for requests; offset increments by limit [OK]
Common Mistakes:
MISTAKES
  • Using offset 1 instead of 0 for first batch
  • Requesting fewer batches than needed
  • Adding extra offset beyond total items

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes