Why you can't prevent overbooking, only shrink it
transcript
The interviewer asks: why not just prevent overbooking completely? The candidate says you can't. Then proves it.
Wanderstay takes 600,000 bookings a day. 1 in 2,000 is overbooked. About 300 guests a day arrive to no room. Leadership wants it 10 times lower. About 30 a day.
The catch: hosts sell the same rooms on other sites. No transaction spans us and them. So you shrink the window.
Here's the subtle bug. A channel sends: available is 3. Meanwhile a guest books here. Our sold count goes up. Then the message lands. Blind overwrite. Available is 3 again. It was sent before our sale. Now our sale is undone.
A blind overwrite lets a stale message win. And undo real sales. Instead, apply a channel update only if its sequence is newer. And our own sold count stays authoritative.
One more move. The last room, while sync from other sites is stale? Switch it to request to book. That's exactly when overbooking strikes.
So the honest goal isn't zero. It's a smaller window, and a good process for what's left. The rest get relocated to an equal or better room.
Full breakdown in the lecture.