When many users want the same scarce thing
Concurrency · distributed systems
The problem. Limited inventory, many buyers, all in real time. Two people must never win the same slot, and the system can't seize up under contention.
How I think about it. I reach for explicit state and atomic operations over optimistic locking and hope: a clear reserve, confirm, or expire lifecycle, so the rules live in one place and a half-finished purchase can't corrupt what's available. I built exactly this as a dedicated service and rolled it out market by market.