Design Patterns Cheat Sheet: All 23 GoF Patterns, One Page
Every Gang of Four pattern with a one-line intent, a real-world example, and a link to the full note
☰ Jump to section
This is a scannable, one-page reference to all 23 Gang of Four design patterns - what each one does, a one-line real-world example, and a link to the full revision note where one exists. Use it the night before an interview to jog your memory, not as your first introduction to any pattern - if a name here is unfamiliar, read the complete Design Patterns guide first.
01Creational Patterns
Concerned with how objects get created, so the rest of the system doesn't depend on concrete classes.
| Pattern | Intent | Example | Full Note |
|---|---|---|---|
| Singleton | Exactly one instance, one global access point | A database connection pool | Read note |
| Factory Method | Let subclasses decide which concrete class to instantiate | A VehicleFactory that returns Car, Bike, or Truck | Read note |
| Abstract Factory | Produce families of related objects without specifying concrete classes | A UI toolkit that creates matching buttons and checkboxes per theme | Read note |
| Builder | Construct a complex object step by step | Assembling an HTTP request with many optional headers | Read note |
| Prototype | Create new objects by copying an existing instance | Cloning a pre-configured game character template | Read note |
02Structural Patterns
Concerned with how classes and objects are composed into larger structures.
| Pattern | Intent | Example | Full Note |
|---|---|---|---|
| Adapter | Convert one interface into another that a client expects | Wrapping a legacy payment API to match a new interface | Read note |
| Bridge | Decouple an abstraction from its implementation so both can vary independently | A RemoteControl abstraction that works with any Device implementation | Read note |
| Composite | Treat individual objects and compositions of objects uniformly | A file system of files and folders, both traversable the same way | Read note |
| Decorator | Attach new behavior to an object at runtime without subclassing | Adding scroll bars or borders to a UI component dynamically | Read note |
| Facade | Offer a simplified interface over a complex subsystem | A single checkout() call that hides inventory, payment, and shipping calls | Read note |
| Flyweight | Share common state across many objects to save memory | Reusing glyph objects across millions of characters in a text editor | Not yet published |
| Proxy | Provide a stand-in that controls access to another object | A lazy-loading image placeholder that fetches the real image on demand | Read note |
03Behavioral Patterns
Concerned with how objects communicate and distribute responsibility.
| Pattern | Intent | Example | Full Note |
|---|---|---|---|
| Observer | Notify all dependents automatically when one object's state changes | Event listeners in a pub/sub system | Read note |
| Strategy | Make an algorithm swappable at runtime behind a common interface | Choosing a pricing strategy by day, weekend, or holiday rate | Read note |
| Command | Encapsulate a request, and its undo logic, as a standalone object | Undo/redo stacks in a text editor | Read note |
| State | Let an object change its behavior when its internal state changes | A vending machine's Idle / HasMoney / Dispense states | Read note |
| Chain of Responsibility | Pass a request along a chain of handlers until one handles it | HTTP middleware and authentication pipelines | Read note |
| Template Method | Define an algorithm's skeleton, let subclasses override individual steps | A DataParser base class with format-specific parse() overrides | Read note |
| Iterator | Access elements of a collection sequentially without exposing its structure | Every for-each loop in every language | Read note |
| Mediator | Centralize complex communication between objects into one mediator | An air-traffic-control style coordinator between planes | Not yet published |
| Memento | Capture and externalize an object's state so it can be restored later | Undo history and save/restore snapshots | Read note |
| Visitor | Add new operations to a group of related classes without modifying them | A tax-calculation visitor applied across different Product subclasses | Not yet published |
| Interpreter | Define a grammar representation and an interpreter to evaluate it | Simple rule engines and expression parsers | Not yet published |
04Which Ones Actually Matter for Interviews
You will not be asked to recite all 23. In practice, Singleton, Factory Method, Builder, Decorator, Facade, Observer, Strategy, Command, and State cover the overwhelming majority of LLD interview problems - see the full breakdown in the Design Patterns guide for why those nine dominate, and practice them directly on real problems like Parking Lot, Vending Machine, and Elevator System.
Frequently Asked Questions
AThe Gang of Four book defines 23 patterns across three categories: Creational, Structural, and Behavioral.
LLDCanvas Team
Engineering at LLDCanvas
Ready to practice?
Turn reading into results
110+ LLD interview questions, a live canvas, and timed Interview Mode.
Reader’s Notes (0)
Sign in to join the discussion
Sign inLoading notes…