Explain Pub/Sub vs RPC.

Pub/Sub (publish-subscribe) is an asynchronous one-to-many messaging model, while RPC (remote procedure call) is a synchronous one-to-one request-response communication method.

When to Use

Use Pub/Sub when multiple services need to react to an event independently — ideal for microservices, analytics, or notifications. Choose RPC when a service needs an immediate response — perfect for APIs or user data retrieval.

Example

A “new user signup” triggers Pub/Sub to notify email, billing, and analytics systems. The login flow, however, uses RPC to fetch user credentials in real time.

Want to master these concepts?

Explore Grokking System Design Fundamentals, Grokking the System Design Interview, Grokking Database Fundamentals for Tech Interviews, Grokking the Coding Interview, or Mock Interviews with ex-FAANG engineers.

Why Is It Important

Choosing between Pub/Sub and RPC impacts scalability, latency, and reliability. Pub/Sub scales better with loose coupling; RPC offers simplicity for direct, quick interactions.

Interview Tips

Explain the difference using coupling and timing: Pub/Sub = asynchronous and loosely coupled; RPC = synchronous and tightly coupled. Back your answer with real-world examples.

Trade-offs

Pub/Sub trades immediacy for scalability and decoupling, while RPC provides speed but risks tight coupling and failures cascading across services.

Pitfalls

Don’t force Pub/Sub into request-response patterns.

Overusing RPC can over-tighten dependencies and hurt fault tolerance.

TAGS
System Design Interview
System Design Fundamentals
CONTRIBUTOR
Design Gurus Team
-

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Explore Answers
Is Microsoft test hard?
What is Meta best known for?
What is REST API design?
What happens at the first Amazon interview?
What Is Event-Driven Serverless Design?
Learn what event-driven serverless design is, when to use it, trade-offs, examples, and interview tips. Perfect for system design prep with DesignGurus.io.
How to crack system design round?
Related Courses
Course image
Grokking the Coding Interview: Patterns for Coding Questions
Grokking the Coding Interview Patterns in Java, Python, JS, C++, C#, and Go. The most comprehensive course with 476 Lessons.
4.6
Discounted price for Your Region

$197

Course image
Grokking Modern AI Fundamentals
Master the fundamentals of AI today to lead the tech revolution of tomorrow.
3.9
Discounted price for Your Region

$78

Course image
Grokking Data Structures & Algorithms for Coding Interviews
Unlock Coding Interview Success: Dive Deep into Data Structures and Algorithms.
4
Discounted price for Your Region

$78

Image
One-Stop Portal For Tech Interviews.
Copyright © 2026 Design Gurus, LLC. All rights reserved.