SOLID is a set of tools for managing change, not rules to maximise. Applying every principle everywhere produces the opposite problem: a tiny feature spread across nine interfaces and twelve classes that nobody can follow.
A practical approach:
Start simple (KISS, YAGNI). One class is fine while it's small and has one reason to change.
Refactor when change arrives. The second time a new plan type forces you to edit the
ifchain, extract theCreditRuleinterface (OCP). The first time a test needs to avoid sending email, inject theNotifier(DIP).Always inject I/O (DIP) — database, network, email, clock. This one pays off from day one because it makes testing possible.
Use inheritance only when LSP holds; otherwise compose.
In interviews, name the principle as you use it: "I'll put payment behind a
PaymentGatewayinterface so the booking service doesn't depend on Stripe directly — that's dependency inversion, and it lets us add Razorpay without changing the service."
Principle One-line test you can ask about any class ───────── ────────────────────────────────────────────────────────────── S "Can I describe this class without saying 'and'?" O "Can I add the next variant without editing this class?" L "Would a caller of the parent be surprised by this subclass?" I "Does any implementer have to fake or throw on a method?" D "Does this business logic call `new` on a database/email/HTTP class?"