

CS fundamentals
OOPs and Design Patterns
Classes, SOLID and the design patterns that show up in machine coding and design rounds.
- Handwritten-style
- Diagrams and tables
- Worked examples
Who this notebook is for
Students and developers preparing for object oriented design questions and machine coding rounds. It suits anyone who has written a few classes and wants the reasoning behind good design.
What you will be able to do
- Explain the four pillars of OOP with an example for each
- Apply the SOLID principles to improve a small design
- Choose between factory, builder, strategy and observer for a given problem
- Sketch a class design for a small system in an interview
What's inside
Pick a chapter and the notebook opens right there.
- Classes, Objects & Memory LayoutStack vs Heap, Object Identity, Value vs Reference, Alignment & PaddingStart here
- Encapsulation & Information HidingAccess Modifiers, Invariants, Tell-Don't-Ask, Defensive Copying & Value ObjectsStart here
- Abstraction, Interfaces & ContractsAbstract Classes vs Interfaces, Default Methods, Traits/Mixins & ADTsStart here
- Inheritance & PolymorphismIS-A vs HAS-A, Overriding vs Overloading, Diamond Problem, Virtual Inheritance & SlicingStart here
- Dynamic Dispatch & Vtable InternalsVtable/Vptr Mechanics, Thunks, Double Dispatch, RTTI & JIT DevirtualizationStart here
- Object Lifecycle & RAIIConstruction/Destruction Ordering, Move Semantics, Rule of 0/3/5 & Smart PointersStart here
- Object Relationships & DemeterAssociation vs Aggregation vs Composition, Law of Demeter, Dependency InjectionStart here
- SOLID Principles (Part 1: SRP & OCP)Single Responsibility Actor Analysis, God Object Dismantling, Open-Closed ExtensibilityStart here
- SOLID Principles (Part 2: LSP, ISP, DIP)Liskov Substitution, Contract Theory, Role Interfaces & Martin Coupling MetricsStart here
- Creational: Singleton & FactoryThread-Safe DCL, Bill Pugh Idiom, Enum Singleton, Factory Method & Static FactoriesStart here
- Creational: Abstract Factory & BuilderProduct Families, Fluent Builder, Step Builder Wizard, Prototype & Copy ConstructorsStart here
- Structural: Adapter, Facade & DecoratorClass vs Object Adapter, Subsystem Facade, Dynamic Decorator & Java I/O StreamsStart here
- Structural: Proxy, Composite & FlyweightVirtual/Protection Proxies, Dynamic Proxies, Recursive Trees & Flyweight RAM OptimizationStart here
- Behavioral: Strategy & ObserverRuntime Strategy Swapping, Modern Lambdas, Event Pub/Sub & Lapsed Listener GC LeaksStart here
- Behavioral: Command, State & TemplateUndo/Redo Dual-Stacks, Sagas, FSM State Transitions & Template Invariant SkeletonsStart here
- Language Internals & Object ModelsHotSpot Mark/Klass Word, Compressed OOPs 32GB Cliff, C++ Fixups, Python __slots__Start here
- Low-Level Design (LLD) BlueprintsParking Lot System, O(1) Tic-Tac-Toe Engine, Elevator LOOK Algorithm & Scoring RubricStart here
- Master Synthesis & Top 15 Q&A23 GoF Matrix, Top 10 Anti-Patterns, Thread-Safe Concurrency & Senior Tech Round ChecklistStart here
Practice this
Put it to work on LakeBench.
Common questions
- Which language are the examples in?
- The ideas are language neutral, and the examples use common object oriented syntax so you can follow them in Java, C++ or Python.
- Will it help with low level design interviews?
- Yes. It builds from classes to patterns and ends with design blueprints you can practise on.
- Can I read a sample before I commit?
- Yes. The contents pages and the first pages of every notebook can be read online, so you can judge the style before going further.



