Ranked Deals Discovery and Claim Service
Design a deals platform that ingests heterogeneous weekly feeds, serves personalized active-deal pages, and enforces one claim per user and deal.
Problem statement
For this exercise, assume partners deliver weekly deal feeds through several batch pipelines. The platform normalizes and publishes deals with start and end times.
A signed-in user browses currently active deals in stable pages of 20, applies category and merchant filters, and receives a ranking influenced by recent browsing history.
A user may claim a deal at most once; a successful claim must remain authoritative across retries, concurrent requests, cache staleness, and deal expiry. Newly published deals should become discoverable promptly, while ranking features may be somewhat stale.
Design ingestion, canonical deal state, active filtering, personalized retrieval and pagination, claim transactions, caching, and failure recovery. Exclude payment, coupon redemption at a merchant, partner settlement, and the machine-learning model internals.
What to build
- The platform ingests heterogeneous weekly partner feeds, validates and normalizes versions, and publishes deals with explicit active intervals.
- A signed-in user can apply supported filters and page through currently active deals 20 at a time in a ranking influenced by recent browsing history.
- A signed-in user can idempotently claim an active deal at most once and retrieve the authoritative claim outcome.
At scale
- Assume 10 million daily active users, 5 million incoming deal records in a weekly batch, and 1 million currently active canonical deals.
- Support 5,000 browse requests and 500 claim attempts per second at peak; target p95 browse latency below 300 ms and claim latency below 1 second.
- Publish a validated feed within one hour, allow ranking features to lag browsing events by up to 24 hours, and apply deal activation or expiry to new browse and claim decisions within one minute.
- Retain claim records for seven years and survive a single-zone failure without accepting a second authoritative claim for the same user and deal.