OpenBook
  • Problems
  • Tracks
  • How it works
  • Pricing
Start practicingSign In
Problems/CRUD & REST

22. Inventory Reservations

Medium

Reserve stock for a cart, then confirm or release it, with holds that expire and hand their stock back on their own.

40 minute budget0.0% acceptanceinventory · expiry · state machine

Requirements

  1. 01Create products with an on-hand stock count and read them back with what is still available.
  2. 02A cart reserves quantities of one or more products; the hold lasts a while, then expires.
  3. 03Available is on hand minus the quantities held by active reservations; expired holds return their stock automatically.
  4. 04Confirming a reservation removes its quantities from on hand; releasing it returns them.
  5. 05Time comes from the x-now header when present, so tests control the clock.

What the hidden tests check

  • Everything the interviewer tells you is checked.
  • Status codes for invalid input, unknown ids and state conflicts are checked on every route.

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.