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.

Google
System Design
Software Engineer
Google
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

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
state machines
idempotency
purchase tokens
webhooks
refunds
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. 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 Problems
Sample 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
  1. App calls the Play Billing library, which shows Play's purchase sheet (the app never sees card details).
  2. Play Purchase Service creates an order with order_id and idempotency key from the c...

Submit Your Answer
Markdown supported