All Patterns
📍 Learning Roadmap

Start with AI.
Build from there.

A clear path through 58 patterns — AI agents first, then the ML systems that support them, then the classic foundations that power it all.

18 AI & Agent patterns
10 Emerging patterns
8 ML System patterns
22 Foundation patterns
🤖

Start Here

AI & Agents

How LLMs reason, act, remember, and collaborate. These patterns run every serious AI product in production today.

18 patterns
1

Agent Handoffs

One agent transfers full conversational control to a specialized peer — the receiving agent takes over completely, with context, not just a subtask.

intermediate
2

RAG

Prevent hallucinations and stale answers by retrieving real, relevant documents before the LLM generates a response.

beginner
3

Chain of Thought

Break down complex problems into step-by-step reasoning to improve answer quality.

beginner
4

ReAct

Combine reasoning and action: think through steps and execute tools to solve tasks.

intermediate
5

Tool Use

Give LLMs the ability to call real functions — search the web, run code, query databases, and interact with APIs autonomously.

intermediate
6

Multi-Agent

Coordinate multiple specialized agents working together to solve complex problems.

advanced
7

Reflection

Generate, critique, and refine outputs iteratively to improve quality.

intermediate
8

Memory

Maintain context across interactions using short-term and long-term memory systems.

intermediate
9

Guardrails

Validate inputs and outputs to ensure safety, quality, and compliance.

intermediate
10

Structured Output

Constrain LLM responses to a schema so downstream code can reliably parse and act on them.

beginner
11

Human-in-the-Loop

Pause agent execution and hand off to a human when confidence is low, stakes are high, or an action is irreversible.

intermediate
12

Router

Classify incoming requests and direct them to the best-fit model, agent, or handler.

intermediate
13

Prompt Template

Separate prompt structure from dynamic content to build reusable, testable, and versionable LLM instructions.

beginner
14

Context Management

Keep what's relevant in the limited context window and evict the rest — without losing coherence.

intermediate
15

Scatter-Gather

Fan out a task to multiple agents or tools in parallel, then synthesize their results into a single answer.

intermediate
16

Fallback

Gracefully degrade when a model or tool fails — retry, switch providers, or return a safe default.

intermediate
17

Orchestrator-Worker

One coordinator plans and delegates; many stateless workers execute — then results flow back up.

advanced
18

Streaming

Emit LLM tokens to the client as they're generated — don't wait for the full response.

beginner

Once comfortable with AI agents, explore frontier patterns →

🔮

Then

Emerging — 2026+

Frontier patterns shaping the next generation of AI systems — reasoning, observability, multimodal, and production evals.

10 patterns
1

Harness Engineering

Design the execution environment, permissions, context budget, and constraints that make AI agents reliable in production — Agent = Model + Harness.

advanced
2

MCP (Model Context Protocol)

A universal open standard that lets AI agents connect to any tool, data source, or service through a single, consistent interface — the USB-C of AI integrations.

intermediate
3

Tree of Thought

Explore multiple reasoning branches simultaneously, evaluate them, and prune dead ends — like a chess engine for language.

advanced
4

Self-Consistency

Sample many independent reasoning paths and vote on the most common answer — reliability through redundancy.

intermediate
5

Computer Use Agent

An LLM that perceives the screen, decides what to click or type, and executes actions — operating software like a human would.

advanced
6

LLM Observability

Trace every prompt, token, tool call, and cost in your AI pipeline — so you can debug, optimize, and trust what's running in production.

intermediate
7

Evals-as-Code

Define, run, and version your LLM quality tests in code — so every model or prompt change is evaluated automatically before it ships.

intermediate
8

Semantic Cache

Cache LLM responses by meaning, not exact text — so 'What's the refund policy?' and 'How do I get a refund?' both hit the same cached answer.

intermediate
9

Vision-Language Pattern

Ground language understanding in visual context — letting models see, describe, reason about, and act on images alongside text.

intermediate
10

Prompt Caching

Cache expensive prompt prefixes server-side so repeated context isn't re-processed on every request.

intermediate

Then learn the ML infrastructure layer →

🏗️

Then

ML Systems

Feature stores, model registries, serving pipelines — the infrastructure layer that makes AI reliable and repeatable at scale.

8 patterns

Finally, the classic foundations that power it all →

🧱

When ready

Foundations

Classic GoF patterns — the building blocks underneath every LLM framework, agent runtime, and ML pipeline.

22 patterns
1

Singleton

Ensure a class has only one instance, and provide a global point of access to it.

beginner
2

Factory

Define an interface for creating objects, but let subclasses decide which class to instantiate.

beginner
3

Abstract Factory Pattern

Create families of related objects without specifying concrete classes

advanced
4

Builder Pattern

Separate construction from representation

intermediate
5

Prototype Pattern

Create objects by cloning an existing prototype

intermediate
6

Adapter Pattern

Convert incompatible interfaces into compatible ones

beginner
7

Bridge Pattern

Decouple abstraction from implementation so they can vary independently

advanced
8

Composite Pattern

Compose objects into tree structures to represent hierarchies

intermediate
9

Decorator Pattern

Add responsibilities to objects dynamically

intermediate
10

Facade

Provide a simplified interface to a complex subsystem of classes.

beginner
11

Flyweight Pattern

Share fine-grained objects efficiently to reduce memory usage

advanced
12

Proxy Pattern

Control access to another object through a surrogate

intermediate
13

Chain of Responsibility

Pass a request along a chain of handlers. Each handler decides either to process the request or pass it along the chain

intermediate
14

Command

Encapsulate a request as an object, allowing you to parameterize clients with different requests, queue them, and log them

intermediate
15

Iterator

Provide a way to access the elements of an object sequentially without exposing its underlying representation

beginner
16

Mediator

Define an object that encapsulates how a set of objects interact

intermediate
17

Memento

Capture and externalize an object's internal state without violating encapsulation, allowing it to be restored later

intermediate
18

Observer

Define a one-to-many dependency where when one object changes state, all its dependents are notified automatically

beginner
19

State

Allow an object to alter its behavior when its internal state changes

intermediate
20

Strategy

Define a family of algorithms, encapsulate each one, and make them interchangeable

beginner
21

Template Method

Define the skeleton of an algorithm in a base class, deferring some steps to subclasses

beginner
22

Visitor

Represent an operation to be performed on elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates

advanced

Ready to test what you've learned?

The interview simulator runs 45-minute timed sessions with real questions on AI and classic patterns.