Design a personalized weekly deals service with multi-source ingestion, active windows, filters, ranking, stable pagination, and one claim per user and deal. Cover idempotency, corrected data, cold starts, concurrent claims, expiration, cache behavior, privacy, observability, and recovery.
# Design a Personalized Weekly Deals Service
Design a service that ingests deals weekly from several pipelines. Each deal has a start and end time and can be active only within that window. Users browse active deals on a main page, twenty per page by default, apply filters, and receive a ranking informed by browsing history. A user may claim a given deal at most once.
Cover ingestion, validation, storage, active-window queries, ranking, pagination, claim correctness, and failure recovery. Do not assume ranking must be a machine-learning model; begin with the simplest approach that meets the stated behavior.
### Clarifying Questions to Ask
- Can different pipelines send the same deal or later corrections?
- Is claim inventory limited, or is only per-user uniqueness required?
- How fresh must browsing history and ranking be?
- Must pagination remain stable while ranks or active windows change?
- Which filters and sort options are required?
### What a Strong Answer Covers
```premium-lock What a Strong Answer Covers
```
### Follow-up Questions
- How would globally limited inventory change the claim transaction?
- How would you explain a recommendation to a user?
- How would you backfill corrected deals without disrupting pagination?
- What privacy limits apply to browsing-history features?
Quick Answer: Design a personalized weekly deals service with multi-source ingestion, active windows, filters, ranking, stable pagination, and one claim per user and deal. Cover idempotency, corrected data, cold starts, concurrent claims, expiration, cache behavior, privacy, observability, and recovery.
Design a service that ingests deals weekly from several pipelines. Each deal has a start and end time and can be active only within that window. Users browse active deals on a main page, twenty per page by default, apply filters, and receive a ranking informed by browsing history. A user may claim a given deal at most once.
Cover ingestion, validation, storage, active-window queries, ranking, pagination, claim correctness, and failure recovery. Do not assume ranking must be a machine-learning model; begin with the simplest approach that meets the stated behavior.
Clarifying Questions to Ask Guidance
Can different pipelines send the same deal or later corrections?
Is claim inventory limited, or is only per-user uniqueness required?
How fresh must browsing history and ranking be?
Must pagination remain stable while ranks or active windows change?
Which filters and sort options are required?
What a Strong Answer Covers Premium
Follow-up Questions Guidance
How would globally limited inventory change the claim transaction?
How would you explain a recommendation to a user?
How would you backfill corrected deals without disrupting pagination?
What privacy limits apply to browsing-history features?