Bird
Raised Fist0

Which of the following statements about the Single Responsibility Principle is INCORRECT?

medium🐞 Bug Identification Q14 of Q15
OOP & Design Patterns - Single Responsibility Principle - One Class, One Reason to Change
Which of the following statements about the Single Responsibility Principle is INCORRECT?
ASRP means a class should only have one method to ensure simplicity.
BApplying SRP improves cohesion and reduces coupling.
CA class should have only one reason to change, which means it should have only one responsibility.
DViolating SRP can lead to fragile code that breaks when unrelated changes occur.
Step-by-Step Solution
  1. Step 1: Analyze each statement

    A class should have only one reason to change, which means it should have only one responsibility. correctly states the core SRP definition.
  2. Step 2: Evaluate SRP means a class should only have one method to ensure simplicity.

    SRP is about reasons to change, not the number of methods; a class can have many methods if they serve one responsibility.
  3. Step 3: Confirm options A, B, and D

    Options A, B, and D are true: SRP improves cohesion, reduces coupling, and prevents fragile code.
  4. Final Answer:

    Option A -> Option A
  5. Quick Check:

    SRP ≠ one method per class; it's about one reason to change.
Quick Trick: SRP is about reasons to change, not method count.
Common Mistakes:
MISTAKES
  • Confusing responsibility with method count.
  • Assuming fewer methods always means better design.
  • Ignoring cohesion and coupling effects.
Trap Explanation:
PITFALL
  • Option C is incorrect because SRP focuses on reasons to change, not method quantity.
Interviewer Note:
CONTEXT
  • Tests candidate's ability to distinguish SRP's true meaning from common misconceptions.
Master "Single Responsibility Principle - One Class, One Reason to Change" in OOP & Design Patterns

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More OOP & Design Patterns Quizzes