Bird
0
0

Which of the following is the correct syntax for requesting the third page with 15 items per page using offset-based pagination?

easy📝 Syntax Q3 of 15
Rest API - Pagination Patterns
Which of the following is the correct syntax for requesting the third page with 15 items per page using offset-based pagination?
AGET /items?offset=15&limit=3
BGET /items?offset=30&limit=15
CGET /items?offset=45&limit=15
DGET /items?offset=2&limit=15
Step-by-Step Solution
Solution:
  1. Step 1: Calculate offset for third page with 15 items per page

    Offset = (page number - 1) * limit = (3 - 1) * 15 = 30.
  2. Step 2: Match the calculated offset and limit to the options

    GET /items?offset=30&limit=15 has offset=30 and limit=15, which is correct.
  3. Final Answer:

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

    offset = (page-1)*limit = 30 [OK]
Quick Trick: Offset = (page - 1) x limit [OK]
Common Mistakes:
  • Using offset as page number
  • Swapping offset and limit values
  • Calculating offset incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes