Explain Topic vs Queue.

In messaging systems, a topic broadcasts each message to all subscribers (publish-subscribe), while a queue delivers each message to only one consumer (point-to-point).

When to Use

Use a queue when you need only one worker to process each message (e.g., job execution). Use a topic when multiple independent services must consume the same event (e.g., sending notifications, logging, and analytics together).

Example

A topic is like a group chat—everyone sees the message.

A queue is like a private message sent to just one person.

Want to master these concepts for interviews?

Check out Grokking System Design Fundamentals, Grokking the System Design Interview, and Grokking Database Fundamentals for Tech Interviews. For hands-on practice, try Mock Interviews with ex-FAANG engineers.

Why Is It Important

Choosing between topics and queues determines system scalability, decoupling, and fault tolerance. The wrong choice can cause data loss or duplicated processing.

Interview Tips

In interviews, define both clearly, give a quick example, and explain pub-sub vs point-to-point.

Highlight trade-offs and when you’d use one over the other.

Trade-offs

  • Queue: Simpler, ensures one-time processing, but no broadcast.
  • Topic: Enables fan-out to many subscribers, but adds complexity and risk of duplication.

Pitfalls

Using a queue when multiple consumers need data causes missed information.

Using a topic for single-consumer tasks adds overhead. Also, undelivered messages in topics vanish if no subscriber is active.

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
Confidence-building exercises before high-stakes tech interviews
What is special about Netflix?
What is Cloudflare interview process?
Posing thoughtful questions to clarify ambiguous requirements
How does Netflix select employees?
Why do recruiters go silent?
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.