KatInterview

Build a real-time bidding platform with proxy bids and soft close

System DesignModel answer
HardModel answerSystem Designauctionsreal-timeconsistency

Last updated

Design a scalable auction system handling 500k live auctions, 5M watchers, proxy bidding, reserve prices, buy-it-now, soft close, and sub-200ms bid latency.

Design a real-time bidding platform where sellers list items for auction and buyers compete by submitting bids. The system must handle high concurrency, guarantee bid consistency, and push live updates to millions of watchers.

Functional Requirements

  • Users can create accounts, authenticate, and search or browse active auctions.
  • Sellers create auctions specifying item details, start/end timestamps, opening price, optional reserve price (minimum acceptable sale price), bid increment rules, and an optional instant-purchase price.
  • Buyers submit bids on live auctions and view the current winning price plus bid history.
  • The platform supports proxy bidding: a buyer submits their maximum willingness to pay, and the system automatically raises their visible bid by the minimum increment needed to maintain the lead as competitors bid.
  • Soft close prevents last-second sniping: any bid placed within the final X seconds extends the auction end time by Y seconds.
  • Watchers receive near-instant notifications when the leading price changes, the end time extends, or the auction concludes.
  • When an auction ends, the system unambiguously determines the winner and initiates order fulfillment.

Scale and Performance Targets

  • Millions of registered users.
  • 500,000 concurrent live auctions with approximately 5 million active watchers across all auctions.
  • Popular auctions attract hundreds of thousands of simultaneous watchers; bid activity spikes dramatically in the final seconds.
  • p99 latency from bid acceptance to UI update: under 200 ms.

What You Should Cover

  1. API contracts — define the key endpoints (CreateAuction, GetAuction, PlaceBid, SubscribeAuctionEvents, CloseAuction) with request/response schemas and error conditions.
  2. Data schema — tables for users, items, auctions, bids, watchlists, and orders, including indexes to support efficient queries.
  3. System architecture — the services, datastores, caches, message brokers, and push infrastructure needed.
  4. Bid pricing logic — how reserve prices, tiered increments, proxy maximums, and instant-purchase interact to compute the displayed current price.
  5. Consistency guarantees — how you ensure exactly one winner per auction, no lost winning bids, and correct ordering even under heavy concurrent load in the final seconds.
  6. Idempotency and concurrency control for bid placement — compare row-level locks, optimistic versioning, and single-writer-per-auction patterns; justify your choice.
  7. Real-time update delivery — evaluate polling, long polling, Server-Sent Events, and WebSockets; explain ordering, sequence numbers, and reconnection with backfill.
  8. Sharding and partitioning strategy (e.g., by auction ID), handling of hot auctions, and ensuring total bid ordering.
  9. Auction finalization — timer/scheduler design, idempotent close operations, order creation, and recovery after failures or shard leader changes.
  10. Handling network delays, retries, and clock skew — which clock is authoritative, and how late or duplicate bids are processed.
  11. Fraud and abuse prevention — shill bidding, rate limits, and sellers bidding on their own listings.
  12. Payment and escrow workflow for winners, including failed payment capture and fallback offers.
  13. Security, privacy, and auditability — authentication/authorization, encryption, immutable bid logs, and tamper-evident audit trails.
  14. Capacity estimation — rough QPS/throughput calculations, and key metrics and alerts you would monitor.

Hints

Hint 1

The hardest challenge is maintaining strict bid ordering per auction under high concurrency in the final seconds, while simultaneously pushing updates to hundreds of thousands of watchers with minimal latency.

Hint 2

Separate the write path (strict ordering, single writer per auction) from the read path (massive fan-out, caching, coalescing updates) to handle the different consistency and scale requirements.

Hint 3

Proxy bidding and soft close both require deterministic state machines; routing all bids and close commands through the same ordered log guarantees reproducibility and exactly-once winner determination.