Design Online Auction (eBay) - System Design
An online auction looks like “a listing with a current price that goes up,” and if you model it that way you will lose the interview in the first five minutes. The trap is that an auction is not a CRUD row you update - it is a serialization problem wearing a shopping-site costume. The moment two people bid on the same item at the same instant, you have a race: which bid is higher, which one wins, what is the new current price, and did the loser get told they were outbid. Multiply that by a “hot” item - a rare sneaker drop, a graded Charizard, a concert ticket - where thousands of people pile in during the last ten seconds, and the naive “read price, compare, write price” pattern shreds itself into lost updates and double-wins. Then remember there are 100M active listings and each one has a hard deadline, and every one of those deadlines must fire close to on time, or the auction that “ended at 9:00:00” is still taking bids at 9:00:04 and someone is furious. ...