0
0
HLDsystem_design~20 mins

Pub/sub pattern in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pub/Sub Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Pub/Sub Message Flow

In a Pub/Sub system, what is the correct sequence of events when a message is published?

A1,2,3,4
B1,3,2,4
C2,1,3,4
D1,2,4,3
Attempts:
2 left
💡 Hint

Think about the natural flow from publisher to broker to consumers.

Architecture
intermediate
2:00remaining
Choosing Components for a Scalable Pub/Sub System

Which component is essential to decouple publishers and subscribers in a scalable Pub/Sub architecture?

ADirect connection between publisher and subscriber
BMessage broker or event bus
CShared database for message storage
DLoad balancer between subscribers
Attempts:
2 left
💡 Hint

Consider what allows asynchronous communication without direct links.

scaling
advanced
3:00remaining
Scaling a Pub/Sub System for High Throughput

You need to design a Pub/Sub system that handles millions of messages per second. Which approach best supports this scale?

ASingle centralized broker with vertical scaling
BMultiple distributed brokers with partitioned topics
CDirect peer-to-peer connections between publishers and subscribers
DStoring messages in a relational database for delivery
Attempts:
2 left
💡 Hint

Think about distributing load and avoiding bottlenecks.

tradeoff
advanced
2:30remaining
Tradeoffs in Message Delivery Guarantees

Which delivery guarantee in a Pub/Sub system may cause duplicate messages but ensures no message loss?

AAt most once delivery
BAt least once delivery
CExactly once delivery
DNo delivery guarantee
Attempts:
2 left
💡 Hint

Consider which guarantee prioritizes message safety over duplicates.

estimation
expert
3:00remaining
Estimating Broker Capacity for a Pub/Sub System

You expect 10,000 publishers each sending 100 messages per second, and 1,000 subscribers. Each message is 1 KB. What is the minimum network bandwidth in Mbps the broker must support to handle incoming messages?

A8 Mbps
B80 Mbps
C8,000 Mbps
D80,000 Mbps
Attempts:
2 left
💡 Hint

Calculate total messages per second and multiply by message size, then convert to Mbps.