Bird
0
0

Which design choice best supports efficient notifications to thousands of subscribers without blocking the main process?

hard📝 Trade-off Q15 of 15
LLD - Design — Online Shopping Cart
You are designing a scalable notification system for state changes in a distributed application. Which design choice best supports efficient notifications to thousands of subscribers without blocking the main process?
AUse asynchronous message queues to dispatch notifications
BNotify all subscribers synchronously in a loop
CStore notifications in a database and poll subscribers
DSend notifications only when the system restarts
Step-by-Step Solution
Solution:
  1. Step 1: Understand scalability needs

    Thousands of subscribers require non-blocking, efficient notification delivery.
  2. Step 2: Evaluate design options

    Synchronous loops block main process; polling adds delay; restart notifications are impractical.
  3. Step 3: Identify best practice

    Asynchronous message queues decouple notification sending, allowing scalable, fast delivery.
  4. Final Answer:

    Use asynchronous message queues to dispatch notifications -> Option A
  5. Quick Check:

    Async queues = scalable notifications [OK]
Quick Trick: Async queues handle many subscribers efficiently [OK]
Common Mistakes:
  • Using synchronous loops causing delays
  • Relying on polling which is slow
  • Sending notifications only on restart

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes