noCV
STOCK-106 · Checkout under contention

Reserve a multi-line order without partial holds

Practice briefStoryAdvanced

An order for a cassette and chain reserves the cassette, then fails on the chain. The abandoned partial hold blocks another buyer for ten minutes.

Focused work estimate
3h 30m + prerequisites
Priority in the scenario
High
Engineering practice
Transactions · Lock ordering · Batch validation

Estimated field mix

  • Database engineering60%
  • Backend40%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional retailer sells bicycle parts from East and West warehouses. Cart reservations last ten minutes, payment callbacks arrive late, and warehouse counts occasionally need correction. The exercise has no real orders or payment integration.

Setup prerequisites

  • Relational modeling
  • Concurrent API requests
  • State transitions

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Reserve all requested lines or none within one warehouse.
  • Combine repeated SKU lines before checking stock.
  • Concurrent orders listing SKUs in opposite orders finish or return bounded retryable failures.

Implementation constraints

  • Set a maximum of 50 distinct SKUs per request and define deterministic acquisition order.

Verification to include

  • Reserve two available lines and verify both holds.
  • Fail the second line and run opposite-order concurrent carts; check no partial state.

Deliverables

  • Atomic basket reservation operation and deadlock exercise

Rollout and recovery

Opt in synthetic multi-line carts; fall back to rejecting whole baskets if contention exceeds the agreed budget.

Value of the work

For the engineer: Practice inventory invariants and timed state transitions while balancing customer experience with operational repair.

For the team: Inspect an engineer's handling of overselling, delayed callbacks, warehouse boundaries, and reversible schema changes.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.