Design Threshold Billing That Charges Advertisers as Spend Accrues
Last updated: November 29, 2026
Quick Overview
Design the billing system that charges self-serve Meta advertisers' cards each time their accrued ad spend reaches a billing threshold, plus monthly, and handles failed charges without letting debt grow unbounded.
Meta
November 29, 20260
0
0 solved
Design the billing system that charges self-serve Meta advertisers' cards each time their accrued ad spend reaches a billing threshold, plus monthly, and handles failed charges without letting debt grow unbounded.
Millions of small businesses advertise on Meta with a card on file, and spend accrues continuously from the auction. Interviewers check the handoff from spend aggregation to invoicing, threshold logic under concurrency, payment failure policy, and how ads delivery is paused.
What the Interviewer Expects
- Accrue spend from billable events into an account balance
- Trigger charges at thresholds without double charging
- Grow thresholds for trusted accounts
- Handle failed payments and pause delivery
- Produce invoices and receipts with taxes
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- Two charges trigger at the same time for one account: how do you prevent both?
- How far can spend overshoot the threshold between checks?
- What happens to running ads when a card is declined?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: each ad account has a threshold (for example 750); when unbilled spend reaches it, charge the payment method; also charge on the monthly bill date; on failure retry and ...
High-Level Design
- Spend aggregation (from the billing-grade impression and click pipeline) emits per-account spend increments every minute.
- Billing balance service: per account
unbilled_spend,threshold...