Skip to content
Sharp

Software Architecture · interview question

In implementing the Observer Pattern in Java, what is a common way to handle an observer throwing an exception during a notification?

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

Correct answer

C. Catch the exception and log it, then continue notifying other observers.

Why

A common approach is to catch exceptions thrown by an observer, log the issue, and continue notifying other observers. This ensures that one faulty observer does not disrupt the notification flow.

Test yourself on Software Architecture

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

Start free test
All Software Architecture questions →