Design Exactly-Once In-App Purchase Processing for Google Play Billing
Last updated: November 29, 2026
Quick Overview
Design the Google Play Billing flow that charges a user for an in-app item, grants it to the developer's app exactly once, and survives network drops, app crashes, and retries at every step.
0
0
0 solved
Design the Google Play Billing flow that charges a user for an in-app item, grants it to the developer's app exactly once, and survives network drops, app crashes, and retries at every step.
A Google onsite payments question with Android specifics. The interviewer checks the purchase state machine, idempotency keys across client, Play backend, and payment processor, and the acknowledgement contract with developer servers.
What the Interviewer Expects
- Define a purchase state machine from pending to acknowledged
- Use idempotency keys for every call that moves money
- Give developers a purchase token and a verification API
- Require acknowledgement and auto-refund unacknowledged purchases
- Notify developer backends with real-time notifications and support polling
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
- What happens if the app crashes after payment but before granting the item?
- How do you handle a delayed payment method like cash at a convenience store?
- How does a developer prevent a user from replaying a purchase token?
- How do you handle consumables versus one-time unlocks?
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
- User buys a consumable (gems) or a non-consumable (remove ads) inside an app.
- Payment via cards, carrier billing, wallet balance, or pending methods.
- The item must be granted once and only once,...
High-Level Design
- App calls the Play Billing library, which shows Play's purchase sheet (the app never sees card details).
- Play Purchase Service creates an order with
order_idand idempotency key from the c...