Bird
0
0

Why is the Observer pattern preferred over polling for notifying multiple objects about state changes?

hard🧠 Conceptual Q10 of 15
LLD - Behavioral Design Patterns — Part 2
Why is the Observer pattern preferred over polling for notifying multiple objects about state changes?
APolling is faster and more efficient than Observer
BObserver provides automatic, event-driven updates reducing resource use
CObserver requires objects to check state repeatedly
DPolling avoids coupling between subject and observers
Step-by-Step Solution
Solution:
  1. Step 1: Compare Observer and polling mechanisms

    Observer uses event-driven notifications; polling requires repeated checks.
  2. Step 2: Identify efficiency and coupling benefits

    Observer reduces resource use by notifying only on changes, avoiding constant checks.
  3. Final Answer:

    Observer provides automatic, event-driven updates reducing resource use -> Option B
  4. Quick Check:

    Event-driven updates = Observer advantage [OK]
Quick Trick: Observer notifies automatically, polling wastes resources [OK]
Common Mistakes:
MISTAKES
  • Thinking polling is more efficient
  • Confusing polling with Observer
  • Ignoring coupling differences

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes