Jump to a problem, path or page
Jump to a problem, path or page
The path
Model objects, compare design patterns in JavaScript and Java, and practice the trade-offs in working code.
Part 1
Objects, contracts and models that keep changes local.
Build objects that own their rules, expose small contracts and compose without a fragile inheritance tree.
Part 2
Create objects without coupling the callers to their construction.
Create objects without coupling callers to their construction: singleton, factory method, abstract factory, builder, prototype, and dependency injection.
Part 3
Compose small objects into useful boundaries.
Compose classes and objects into larger structures while keeping them flexible and efficient: adapter, bridge, composite, decorator, facade, flyweight, and proxy.
Part 4
Move decisions and communication behind explicit contracts.
Decouple senders from receivers and coordinate interactions between cooperating classes: observer, mediator, chain of responsibility, and command with undo.
Part 5
Apply patterns, handle concurrency and complete a machine-coding design.
Enterprise and architectural patterns essential for production systems: repository, unit of work, null object, specification, layered architecture, and plugin registries.
Six rules that keep classes small, stable and easy to test: SRP, OCP, LSP, ISP, DIP, and the DRY/KISS/YAGNI heuristics.
Translate requirements into classes, relationships and diagrams that reveal wrong assumptions before a line of code is written.
Control execution flow, algorithm variations, and state transitions across objects: strategy, state, template method, iterator, visitor, memento, and interpreter.
Master thread safety, asynchronous flows, and synchronization: event loops vs threads, producer-consumer queues, thread pools, read-write locks, and double-checked locking.
Recognize destructive architectural anti-patterns, diagnose code smells, avoid pattern mania, and safely refactor legacy code toward design patterns.
Master the practical low-level design interview: structured approach, end-to-end walkthroughs for parking lot, vending machine, and elevator/logger systems.