Single Responsibility Principle (SRP)
A class should have one — and only one — reason to change. 'Reason to change' maps to a specific stakeholder or actor whose requirements drive the class.
SRP = one chef, one station. The grill cook doesn't also wash dishes and seat guests. If the health inspector (actor 1) and the interior designer (actor 2) both change your class, it has two bosses — split it.
SRP is often misread as 'do one thing'. The precise definition is: a class should be responsible to one actor. A User class that handles authentication logic, email formatting, and database persistence has three reasons to change (security team, marketing team, DBA) and three axes of instability. The fix is to extract UserAuthenticator, UserEmailFormatter, and UserRepository — each owned by one actor.
SRP is the principle most violated by accretion: classes start single-purpose and grow. The smell is a class with more than one cluster of methods that cohesively serve different callers. Measure cohesion with LCOM (Lack of Cohesion of Methods): low LCOM means methods share fields; high LCOM signals multiple responsibilities. SRP at the class level mirrors the Unix philosophy at the process level. Violating SRP at scale produces 'God objects' — a single class that represents the entire application state. In microservices, SRP surfaces as service boundary design: each service owns one business capability.
SRP says a class should have exactly one reason to change, meaning it is responsible to exactly one actor. If I have an OrderService that calculates pricing, sends confirmation emails, and writes to the database, that is three reasons to change — pricing rules change, email templates change, schema changes. I split it into PricingEngine, OrderNotifier, and OrderRepository. Each is independently testable and deployable in a separate module.
Do not say 'a class should do one thing' — that is the Unix principle, not SRP. The distinction matters: a class can do many related things as long as they all serve the same actor. An interviewer will probe whether you understand the actor framing.