Loading page…
One strong interview answer to hotel bookings: modest traffic on one PostgreSQL, inventory as a count per room type per night, the capacity check inside a conditional UPDATE across all nights, a unique idempotency key against double clicks, and a hold, pay, confirm saga with expiry, a sweeper and compensations for late payments.
Booking a hotel room looks like a shopping cart with dates.