Bird
0
0

Which of the following is the correct way to request the second page of results with 10 items per page using offset-based pagination?

easy📝 Syntax Q12 of 15
Rest API - Pagination Patterns
Which of the following is the correct way to request the second page of results with 10 items per page using offset-based pagination?
AGET /items?start=10&count=10
BGET /items?offset=10&limit=10
CGET /items?page=2&limit=10
DGET /items?offset=2&limit=10
Step-by-Step Solution
Solution:
  1. Step 1: Calculate offset for page 2 with 10 items per page

    Offset = (page number - 1) * limit = (2 - 1) * 10 = 10.
  2. Step 2: Identify correct query parameters

    Offset and limit are standard; page parameter is not used in offset-based pagination.
  3. Final Answer:

    GET /items?offset=10&limit=10 -> Option B
  4. Quick Check:

    Offset = 10 for page 2 with 10 items [OK]
Quick Trick: Offset = (page - 1) x limit for correct pagination [OK]
Common Mistakes:
  • Using page instead of offset
  • Setting offset to page number directly
  • Using non-standard parameter names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes