Bird
Raised Fist0

A developer implemented the Chain of Responsibility pattern but notices that requests are not handled properly. What is a likely cause?

medium📝 Analysis Q14 of Q15
LLD - Behavioral Design Patterns — Part 2
A developer implemented the Chain of Responsibility pattern but notices that requests are not handled properly. What is a likely cause?
AHandlers are tightly coupled and call each other directly.
BAll handlers process the request simultaneously causing conflicts.
CThe chain is broken because a handler does not pass the request forward.
DThe pattern requires all handlers to be singletons.
Step-by-Step Solution
Solution:
  1. Step 1: Review Chain of Responsibility behavior

    Requests pass along a chain until a handler processes it or passes it on.
  2. Step 2: Identify common error

    If a handler fails to forward unhandled requests, the chain breaks and requests stop prematurely.
  3. Final Answer:

    The chain is broken because a handler does not pass the request forward. -> Option C
  4. Quick Check:

    Broken chain = missing forwarding [OK]
Quick Trick: Ensure each handler forwards unhandled requests [OK]
Common Mistakes:
MISTAKES
  • Confusing tight coupling with chain behavior
  • Assuming all handlers process requests simultaneously
  • Believing singleton pattern is required

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes