Design a Credit-Card Spending Report Platform
Design a reliable reporting system that aggregates card transactions into timely, auditable spending reports.
Problem statement
For this exercise, design a business credit-card spending report platform that gives employees and finance teams current spending reports. Design the ingestion, categorization, aggregation, correction, and serving paths for authorized card transactions, reversals, refunds, and late-arriving settlement updates.
Reports must support per-card, employee, merchant-category, and company views while preserving an auditable ledger. Exclude card authorization decisions and money movement.
What to build
- Ingest transaction lifecycle events while retaining the processor identity and revision history.
- Serve authorized company-scoped summaries and drill-downs by card, employee, category, and time range.
- Apply reversals, refunds, category corrections, and late settlement changes without double counting.
- Produce repeatable exports tied to one report version and explain every aggregate from ledger entries.
At scale
- Process 10,000 transaction events per second at peak across 100,000 companies.
- Make accepted events visible in reports within one minute at p95.
- Retain seven years of immutable ledger history and support a company-month export within two minutes.
- A retry or out-of-order lifecycle event must not change totals twice.