Object-Oriented Programming
oop
Question Banks
Java OOP Fundamentals
Mid-tier Java drills on interfaces vs abstract classes, the equals / hashCode contract, generics type erasure, and Comparable / Comparator. Concrete code stems you can compile.
Design Patterns Walk-Through
Hard drills on Singleton, Strategy, Observer, and Decorator. Concrete Java implementations to read, critique, and extend, plus one thread-safety twist.
Community
The Builder Pattern: When the Constructor Isn't Enough
The Builder pattern earns its keep when constructors blow up to ten parameters or when an object's invariants depend on a multi-step assembly. The shape, the cases that justify it, and the imitations that don't.
Composition Over Inheritance, with Real Examples
The slogan everyone repeats and almost no one operationalizes. What composition actually looks like at the field level, where inheritance is still right, and the refactor when you've gone too deep.
The Strategy Pattern: The Cleanest Way to Kill an if-else Chain
Strategy is taught as an OO pattern, but in practice it is just a function with a name. How to recognize the if-else chains that genuinely deserve the refactor and the ones that don't.
Building Smarter Code: Singleton & Factory Method
Singleton is the pattern most teams over-apply, and Factory Method is the one most teams reach for too late. Where each pays off, where each rots, and the rules I follow.
Adapter and Facade: The Two Patterns I Actually Use
Two structural patterns that survive every codebase: Adapter (when you cannot change the other side) and Facade (when you cannot change yours). The shape of each, and the small tells that say which one fits.
Dependency Injection Without a Framework
DI is a pattern, not a framework. The plain-language version (pass things in instead of newing them inside) covers ninety percent of cases. The trade-off versus DI containers, and where each one breaks down.
Prototypes vs Classes: What Is Actually Happening
The contrarian take that classes are no longer just syntactic sugar over prototypes. Walks the prototype chain, what new actually does, and the five things class adds that pure-prototype code cannot replicate without contortion.
