Design a Global Pub/Sub Messaging Service for Google Cloud
Last updated: November 29, 2026
Quick Overview
Design a managed publish-subscribe service where publishers send messages to topics and many independent subscriptions receive them with at-least-once delivery, acknowledgments, and redelivery.
0
0
0 solved
Design a managed publish-subscribe service where publishers send messages to topics and many independent subscriptions receive them with at-least-once delivery, acknowledgments, and redelivery.
Cloud Pub/Sub is a building block for many Google Cloud customers, and the design tests durable storage, fan-out, flow control, and acknowledgment tracking at scale. Interviewers check how per-subscription ack state is kept and how ordering is offered.
What the Interviewer Expects
- Separates publish path from delivery path
- Stores messages durably before acknowledging publish
- Tracks acks per subscription efficiently
- Supports push and pull with flow control
- Explains ordering keys and exactly-once options
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
- How do you store ack state for a subscription with a billion unacked messages?
- How do you deliver ordered messages per key without stalling everything?
- How do you handle a subscriber that never acks?
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: create topics and subscriptions; publish messages (up to 10 MB); pull or push delivery; ack, nack, ack deadline extension; retention up to 7 days; seek to timestamp; optional ordering ...
High-Level Design
- Publish frontends receive messages, batch them, and write to storage servers that persist message batches replicated across zones before acking the publisher.
- Topics are split into **par...