Skip to content
Sharp

Software Architecture · interview question

In the Observer Pattern, how can a subject handle the case where an observer throws an exception during notification?

Multiple choiceHardchapter-13-curatedpremiumsoftware-architectureobserver-pattern
Choose one answer
Answer and explanation

Correct answer

A. Catch exceptions and handle them individually to ensure other observers are still notified.

Why

Catching exceptions and handling them individually ensures that other observers are still notified, maintaining the system's resilience and ensuring that one failing observer does not affect the entire notification process.

Test yourself on Software Architecture

A free test with instant, explained results. No account needed.

Start free test
All Software Architecture questions →