Bird
Raised Fist0

You see a class named "UserManager" that handles user authentication, profile updates, and sending welcome emails. Which of the following is the most likely misconception about SRP in this design?

medium🐞 Bug Identification Q7 of Q15
OOP & Design Patterns - Single Responsibility Principle - One Class, One Reason to Change
You see a class named "UserManager" that handles user authentication, profile updates, and sending welcome emails. Which of the following is the most likely misconception about SRP in this design?
AThe class is well-designed because all methods relate to user management.
BThe class violates SRP because it has multiple reasons to change.
CCombining related user functions improves cohesion and follows SRP.
DSplitting the class would increase complexity unnecessarily.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze responsibilities

    Authentication, profile updates, and email sending are distinct reasons to change.
  2. Step 2: Identify misconception

    Assuming all user-related functions belong in one class ignores SRP's focus on reasons to change.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Related domain ≠ single responsibility [OK]
Quick Trick: SRP is about reasons to change, not just related domain [OK]
Common Mistakes:
MISTAKES
  • Equating related functions with single responsibility
  • Believing splitting always adds complexity
Trap Explanation:
PITFALL
  • Candidates confuse domain cohesion with SRP's change-based responsibility.
Interviewer Note:
CONTEXT
  • Reveals candidate's grasp of SRP's core principle versus domain grouping.
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