~learn.
0:00 / 1:24
Mock interview · Wanderstay

The guest paid. The room went to someone else.

transcript

The guest paid. The room went to someone else. The interviewer asks: how did your design allow this?

A guest books a room. PayNest charges the card. But our call to PayNest times out. The saga calls it a failure. It releases the hold. A minute later, the room sells to someone else.

The candidate finds it in one line. A timeout was treated as failure. But the money may have moved. A timeout means: we don't know.

The fix is a new state. Payment unknown. The hold is extended. Nobody else can take the room. Then ask PayNest for the status, with the same key. Authorized? Confirm. The guest gets the room they paid for. Only a definite decline releases the room.

No answer within 15 minutes? Keep the hold, alert, and reconcile. The interviewer pushes. You're holding a room nobody may have paid for.

Release too early, and a charged guest has no room. No undo. Hold too long? The room goes back on sale a little late. That's all it costs.

Holding is cheap and reversible. Releasing isn't. A timeout means unknown. Ask before you undo anything.

Full breakdown in the lecture.