← Architecture Lab

Seat Locking Simulator

Two users, eight seats, one lock. You control both users — take the same seat twice and watch what stops you. Every rejection here is a defense that exists in production for a reason.

For how the lock is designed rather than how it behaves, read Distributed Seat Locking.

Try to break it

0/5 found

Four ways to attack the seat lock, and one that only works once you've seen all four fail. The server log names which defense stopped you. Both phones below are yours.

  • Double-book a seat

    Take the same seat on both phones.

    Not yet done
  • Back out of a hold

    Hold a seat, then cancel before paying.

    Not yet done
  • Let a hold expire

    Hold a seat and do nothing.

    Not yet done
  • Pay with a dead token

    Open checkout, then wait before you confirm.

    Not yet done
  • Locked

    Locked — find the four defenses first.

    Locked

Lock implementation

Find all four defenses to unlock the version without the atomic guarantee.

Two phones, one seat map

Take the same seat on each and watch the screens disagree — then read the log for what the server actually did.

user Aidle

Choose a seat

greyed seats are taken. this phone is never told by whom.

user Bidle

Choose a seat

greyed seats are taken. this phone is never told by whom.

server — what actually happened

idle — pick a seat on either phone. hold ttl 10s.

Both timers are compressed. Production holds a seat for 120s and allows a 10s payment grace window; here they are 10s and 5s so the whole cycle fits inside a browser tab.