Bird
0
0

In a Chain of Responsibility pattern, if Handler 1 cannot process a request, what is the next step in the request handling flow?

medium📝 Analysis Q5 of 15
LLD - Behavioral Design Patterns — Part 2
In a Chain of Responsibility pattern, if Handler 1 cannot process a request, what is the next step in the request handling flow?
AHandler 1 retries processing the request indefinitely.
BThe request is discarded immediately.
CThe request is passed to Handler 2 for processing.
DThe request is broadcast to all handlers simultaneously.
Step-by-Step Solution
Solution:
  1. Step 1: Understand Chain of Responsibility

    Each handler decides whether to process the request or pass it along the chain.
  2. Step 2: Passing the Request

    If Handler 1 cannot handle the request, it forwards it to the next handler in the chain, Handler 2.
  3. Final Answer:

    The request is passed to Handler 2 for processing. -> Option C
  4. Quick Check:

    Requests flow sequentially through handlers until processed [OK]
Quick Trick: Unprocessed requests move to next handler in chain [OK]
Common Mistakes:
MISTAKES
  • Discarding requests prematurely
  • Handlers retrying endlessly without passing on
  • Broadcasting requests to all handlers at once

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes