Back to problems

Design a donations service with 3-day rolling totals

System Design · DoorDash · Medium

Design a donation ingestion platform that continuously accepts contributions and exposes rolling 72-hour aggregate metrics. Each ingested event includes a unique donation_id, a user_id, a campaign_id, a numeric amount, a currency code, and a created_at event timestamp. The service must support two APIs: GET /campaigns/{id}/total?window=72h — returns the total amount donated to the given campaign over the rolling 72-hour window. GET /leaderboard?window=72h&k=100 — returns the…

Checking your access…