Bird
0
0

Given the API call GET /products?offset=5&limit=3 and the product list ["A", "B", "C", "D", "E", "F", "G", "H"], what will be the returned products?

medium📝 Predict Output Q13 of 15
Rest API - Pagination Patterns
Given the API call GET /products?offset=5&limit=3 and the product list ["A", "B", "C", "D", "E", "F", "G", "H"], what will be the returned products?
A["D", "E", "F"]
B["E", "F", "G"]
C["F", "G", "H"]
D["G", "H"]
Step-by-Step Solution
Solution:
  1. Step 1: Identify starting index using offset

    Offset 5 means skip first 5 items: A(0), B(1), C(2), D(3), E(4) skipped; start at index 5.
  2. Step 2: Select limit number of items from offset

    Limit is 3, so select items at indices 5, 6, 7: F, G, H.
  3. Final Answer:

    ["F", "G", "H"] -> Option C
  4. Quick Check:

    Offset 5 + limit 3 = F, G, H [OK]
Quick Trick: Start at offset index, take limit items [OK]
Common Mistakes:
  • Starting at offset - 1 index
  • Including offset item in skipped items
  • Returning fewer or more items than limit

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes