Design an Online Auction System
Design a scalable, highly available online auction platform where users can list items for auction and other users can place bids in real time.
The system should support:
-
User registration and authentication.
-
Sellers creating auction listings (item details, starting price, start/end time, optional reserve price, etc.).
-
Buyers viewing active auctions and placing bids.
-
Real-time updates of the current highest bid to all interested clients.
-
Correct determination of the winning bid when the auction ends.
Assume:
-
Millions of registered users.
-
Peak of hundreds of thousands of concurrent users watching and bidding on popular auctions.
-
Strong business requirement that bids are processed correctly and that the auction winner is determined accurately, especially near the end of an auction when many users may bid at the same time.
You should:
-
Propose a
high-level architecture
(services, data stores, caches, message queues, etc.).
-
Design the
data model
for auctions, bids, and users.
-
Explain how you will handle
real-time bid updates
to clients and discuss trade-offs between:
-
Polling
-
Long polling
-
Server-Sent Events (SSE) (and you may contrast with WebSockets if helpful)
-
Explain how you will ensure:
-
Consistency of bids (no two winners, no lost winning bid).
-
Scalability at high load (especially near auction end times).
-
Fault tolerance and high availability.
-
Discuss how you would:
-
Prevent or mitigate last-second bid sniping.
-
Handle network delays and retries on bid submission.
Walk through the main flows:
-
Creating an auction.
-
Placing a bid.
-
Broadcasting bid updates to watchers.
-
Closing an auction and determining the winner.
Highlight key design decisions, trade-offs, and any optimizations you would make.