- Published on
- • Views
Design Patterns Quick Overview
- Authors
- Name
- Anirudh Mitra
- @BrownVitriol
Table of Contents
Design patterns are reusable solutions to common software design problems. Here's a very-short breakdown of the three main categories:
Creational Patterns
- Singleton: One instance, global access.
- Factory Method: Interface-driven object creation.
- Abstract Factory: Create related objects without specifying concrete classes.
- Builder: Step-by-step complex object construction.
- Prototype: Clone existing objects.
Structural Patterns
- Adapter: Bridge between incompatible interfaces.
- Decorator: Dynamically add behavior to objects.
- Facade: Simplify complex systems with a unified interface.
- Composite: Tree structures for part-whole hierarchies.
- Proxy: Placeholder to control access.
- Bridge: Separate abstraction from implementation.
- Flyweight: Share common data to save memory.
Behavioral Patterns
- Observer: Notify changes to dependent objects.
- Strategy: Swap algorithms dynamically.
- Command: Encapsulate requests as objects.
- State: Change behavior based on state.
- Template Method: Algorithm structure with flexible steps.
- Mediator: Simplify object communication.
- Chain of Responsibility: Pass requests along a handler chain.
- Iterator: Sequentially access collection elements.
- Visitor: Add operations without altering object structure.
Knowing when and how to apply these patterns is key to acing your system design interview. Prepare to discuss real-world use cases!