All guide activities

CH-13 · CHAPTER REVIEW

Worked interview ticket booking

Solve these two questions after studying the chapter. State your assumptions and explain your reasoning.

Read. Try. Defend.

Companion to the Buildfest System Design guides.

Chapter review: two questions

Attempt both questions before opening the model answers.

Question 1

Two buyers request the last seat at the same time. Describe the atomic database decision, the loser response and the retry after the winner loses its reply.

Reveal model answer

A conditional hold update or correct transaction permits one winner. The other request gets an unavailable result. The winner retries with its original operation key and retrieves the existing outcome. Persist the relevant reservation and operation result consistently and keep a unique sale invariant for the show and seat.

Question 2

Payment success arrives for an expired hold after a new buyer reserved the seat. State what must not happen and propose a recovery policy.

Reveal model answer

Do not overwrite the new holder or create a second confirmed sale. Authenticate and match the event to the old operation and hold token, check the current state, then use the declared refund/manual reconciliation path if the sale is no longer valid. Recovery must protect both seat ownership and the money outcome.

Answers stay in this tab. Download before leaving. This practice is not graded or saved to your account.