Design Real-Time Payment Announcements for Merchant Soundboxes
Last updated: November 29, 2026
Quick Overview
Design the system that makes a shop's PhonePe SmartSpeaker announce 'Received Rs 250 on PhonePe' within a couple of seconds of a successful QR payment, for tens of millions of devices on flaky cellular networks.
PhonePe
November 29, 20260
0
0 solved
Design the system that makes a shop's PhonePe SmartSpeaker announce 'Received Rs 250 on PhonePe' within a couple of seconds of a successful QR payment, for tens of millions of devices on flaky cellular networks.
Offline merchants rely on the soundbox announcement to hand over goods, so a missed or false announcement is a direct trust problem, and the devices sit on cheap 2G or 4G links. The interviewer checks a push-based design with persistent connections, at-least-once delivery with device-side dedup, and how you avoid announcing payments that did not succeed.
What the Interviewer Expects
- Trigger only from the final SUCCESS state of the payment, not from initiation
- Use long-lived device connections (MQTT or similar) with a connection registry
- Deliver at least once with acks and dedup by transaction id on the device
- Handle offline devices with short-lived queued messages and a replay on reconnect
- Plan capacity for connection count, not just message rate
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 should happen if the speaker was offline for an hour and reconnects with 40 pending announcements?
- How do you update firmware or the voice language across millions of devices safely?
- How would you detect a fleet-wide problem, such as a broker cluster dropping connections?
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
Announce within about 2 seconds at p95 after payment success; never announce a failed or pending payment as received; survive brief network drops; support multiple languages; tens of millions of devic...
High-Level Design
The payments service emits a PaymentSucceeded event to Kafka. An Announcement service consumes it, looks up the devices bound to the merchant id, and builds a compact message (txn id, amount, langua...