Bird
0
0

Which of the following is the correct way to request the second page of results with 10 items per page using limit and offset?

easy📝 Syntax Q12 of 15
Rest API - Query Parameters and Filtering

Which of the following is the correct way to request the second page of results with 10 items per page using limit and offset?

GET /items?limit=10&offset=?
A10
B20
C0
D1
Step-by-Step Solution
Solution:
  1. Step 1: Calculate offset for second page

    For page 1, offset is 0. For page 2, offset = limit * (page_number - 1) = 10 * (2 - 1) = 10.
  2. Step 2: Confirm limit remains 10

    Limit stays 10 to get 10 items per page.
  3. Final Answer:

    10 -> Option A
  4. Quick Check:

    offset = limit * (page - 1) = 10 [OK]
Quick Trick: Offset = limit x (page number - 1) [OK]
Common Mistakes:
  • Using offset = page number
  • Using offset = limit x page number
  • Setting offset to 0 for second page

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes