SOLID is five design principles that prevent code from rotting as it grows. Single Responsibility — one class, one reason to change. Open/Closed — open to extension, closed to modification. Liskov — subtypes must honor the contract. Interface Segregation — many small interfaces beat one fat one. Dependency Inversion — depend on abstractions, not concretions. Together they let teams change parts of a system without rebuilding the whole thing.
Every time you're building anything that will live longer than a sprint and be touched by more than one person. SOLID is not about perfection — it's about keeping coupling low enough that tomorrow's change doesn't require rewriting today's code. Critically important in service-oriented architectures where modules become deployable units.
Try it
Why SOLID matters for system design
System design interviews are about trade-offs at the architecture level — but the building blocks are still classes and modules. SOLID is the bridge.
The five, with one-line memory hooks
- S — Single Responsibility · A class should have one reason to change. If you describe what it does using “and”, split it.
- O — Open/Closed · You should be able to add new behavior without modifying existing code. Strategy and Decorator patterns exist for this.
- L — Liskov Substitution · Anywhere a parent type is expected, any subtype should work without surprising the caller. If overriding requires throwing, your hierarchy is broken.
- I — Interface Segregation · Don’t force a client to depend on methods it doesn’t use. Many narrow interfaces beat one wide one.
- D — Dependency Inversion · High-level policy shouldn’t depend on low-level details — both should depend on an abstraction.
The connection to system design
| SOLID principle | System-level expression |
|---|---|
| SRP | Microservices owning one bounded context |
| OCP | Plugin architectures, gateways with pluggable middleware |
| LSP | API versioning that doesn’t break existing clients |
| ISP | API gateways exposing role-specific endpoints (BFF pattern) |
| DIP | Dependency on message brokers / interfaces, not concrete services |
Comments 0
Discuss this page. Markdown supported. Be kind.