Bird
0
0

You want to implement page-based pagination for an API returning 23 items with a limit of 7 per page. How many pages will the client need to request to get all items?

hard📝 Application Q15 of 15
Rest API - Pagination Patterns
You want to implement page-based pagination for an API returning 23 items with a limit of 7 per page. How many pages will the client need to request to get all items?
A3
B4
C5
D7
Step-by-Step Solution
Solution:
  1. Step 1: Calculate full pages

    Each page holds 7 items, so 3 full pages hold 21 items (3 * 7 = 21).
  2. Step 2: Calculate remaining items

    23 total items - 21 = 2 items remain, needing one more page.
  3. Step 3: Total pages needed

    3 full pages + 1 partial page = 4 pages total.
  4. Final Answer:

    4 -> Option B
  5. Quick Check:

    23 items / 7 per page = 4 pages [OK]
Quick Trick: Divide total items by limit, round up for pages [OK]
Common Mistakes:
  • Ignoring leftover items needing extra page
  • Rounding down instead of up
  • Assuming pages equal limit count

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes