Software Architecture · SOLID Principles
How would you answer an interview scenario involving cohesion and SRP?
For an interview scenario involving cohesion and SRP, I would first clarify the business goal, scale, constraints, and the failure or quality attribute the interviewer wants to explore. Cohesion measures how strongly the responsibilities inside a component belong together and is a practical lens for SRP. For production, prefer feature or capability ownership where it improves locality and keep cross-cutting concerns separate. I would then explain the main alternatives and tradeoffs, identify likely failure modes, and describe how I would validate the solution through testing, observability, security controls, and recovery or rollback planning.