All cheat sheets
📦
OOP Concepts
Pillars, SOLID, and how to explain design in interviews.
Four Pillars
| Encapsulation | Hide internals; expose clean interfaces (getters/setters, modules). |
|---|---|
| Abstraction | Show essential features; hide complexity (interfaces/abstract classes). |
| Inheritance | IS-A reuse; prefer composition when hierarchies get deep. |
| Polymorphism | Same interface, different implementations (override / overload). |
SOLID (quick)
| S — SRP | Single Responsibility: one reason to change. |
|---|---|
| O — OCP | Open for extension, closed for modification. |
| L — LSP | Subtypes must be substitutable for base types. |
| I / D | Interface segregation · Depend on abstractions (DIP). |