OpenBook
  • Problems
  • Tracks
  • How it works
  • Pricing
Start practicingSign In
Problems/Data Modeling

7. Search with Filters & Pagination

Medium

Cursor pagination, multi-field filters and stable sorting over a product catalog.

35 minute budget61.7% acceptancepagination · query parsing

Requirements

  1. 01POST /products adds a product { name, category, priceCents, inStock }; the server assigns integer ids in creation order, and GET /products/:id reads one back.
  2. 02GET /products supports q, category, minPrice, maxPrice, inStock, sort, limit and cursor, and returns { items, nextCursor }.
  3. 03Sorting by price or name is deterministic; a leading - sorts descending.
  4. 04Cursor pagination is stable under inserts: no duplicates or gaps across pages, and nextCursor is null on the last page.
  5. 05Invalid body fields and invalid query values return 400 with field-level errors.

What the hidden tests check

  • Everything the interviewer tells you is checked.
  • Pages are fetched while products are being inserted; every product must appear exactly once and the pages must stay in sort order.

4 more details are held back. In a mock interview they come out only when you ask the interviewer the right question; in practice they are listed in the workspace.

Sign in to start

Attempts, files and transcripts are saved to your account so the grader can review how you worked.

Sign inCreate an account
OpenBook

Practice for interviews where you build a feature with an AI assistant.

Early preview. Problems, grading and the interviewer are still changing.

Practice

  • Problems
  • Tracks
  • How it works
  • Pricing

Legal

  • Terms
  • Privacy
© 2026 OpenBook.