Validate requests against a shared record

Four browsers display an earlier message saying that a workshop has five seats available. The booking server's authoritative record initially also contains five available seats. It processes the four requests in the table's order, completing each decision and stored update before starting the next request.


For every request, the server accepts the entire requested group only if enough seats remain. It then subtracts that group's size. Otherwise, it rejects the request without booking any seats. A rejection leaves the stored seat count unchanged. There are no cancellations or other requests.


Enter exactly accept or reject for each decision, and the exact integer number of seats remaining immediately afterward.


Signup browsers send requests to one booking service that reads and updates a shared seat record.


RequestSeats requestedDecisionSeats remaining
13
23
32
41

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Client-Server Architecture Questions: