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.
Start Here
AI & Agents
How LLMs reason, act, remember, and collaborate. These patterns run every serious AI product in production today.
Agent Handoffs
One agent transfers full conversational control to a specialized peer — the receiving agent takes over completely, with context, not just a subtask.
RAG
Prevent hallucinations and stale answers by retrieving real, relevant documents before the LLM generates a response.
Chain of Thought
Break down complex problems into step-by-step reasoning to improve answer quality.
ReAct
Combine reasoning and action: think through steps and execute tools to solve tasks.
Tool Use
Give LLMs the ability to call real functions — search the web, run code, query databases, and interact with APIs autonomously.
Multi-Agent
Coordinate multiple specialized agents working together to solve complex problems.
Reflection
Generate, critique, and refine outputs iteratively to improve quality.
Memory
Maintain context across interactions using short-term and long-term memory systems.
Guardrails
Validate inputs and outputs to ensure safety, quality, and compliance.
Structured Output
Constrain LLM responses to a schema so downstream code can reliably parse and act on them.
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.
Router
Classify incoming requests and direct them to the best-fit model, agent, or handler.
Prompt Template
Separate prompt structure from dynamic content to build reusable, testable, and versionable LLM instructions.
Context Management
Keep what's relevant in the limited context window and evict the rest — without losing coherence.
Scatter-Gather
Fan out a task to multiple agents or tools in parallel, then synthesize their results into a single answer.
Fallback
Gracefully degrade when a model or tool fails — retry, switch providers, or return a safe default.
Orchestrator-Worker
One coordinator plans and delegates; many stateless workers execute — then results flow back up.
Streaming
Emit LLM tokens to the client as they're generated — don't wait for the full response.
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.
Harness Engineering
Design the execution environment, permissions, context budget, and constraints that make AI agents reliable in production — Agent = Model + Harness.
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.
Tree of Thought
Explore multiple reasoning branches simultaneously, evaluate them, and prune dead ends — like a chess engine for language.
Self-Consistency
Sample many independent reasoning paths and vote on the most common answer — reliability through redundancy.
Computer Use Agent
An LLM that perceives the screen, decides what to click or type, and executes actions — operating software like a human would.
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.
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.
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.
Vision-Language Pattern
Ground language understanding in visual context — letting models see, describe, reason about, and act on images alongside text.
Prompt Caching
Cache expensive prompt prefixes server-side so repeated context isn't re-processed on every request.
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.
Feature Store
Centralize feature computation, storage, and serving so training and inference always use the exact same data.
Model Registry
A versioned catalog of trained ML models with metadata, lineage, and stage transitions from staging to production.
Training Pipeline
Automated, reproducible workflows that ingest data, train models, evaluate them, and register successful runs.
Serving Pipeline
Deploy ML models behind a scalable, low-latency API that handles feature lookup, prediction, and response transformation.
Data Versioning
Track datasets like code with immutable versions so any model run can be reproduced months later.
Model Monitoring
Continuously track model performance, input distributions, and prediction drift to catch silent failures in production.
A/B Testing
Safely roll out new models by routing a fraction of traffic to the candidate and comparing business metrics against the control.
Fine-Tuning
Train a base model further on your own data to improve quality, consistency, or efficiency on a specific task.
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.
Singleton
Ensure a class has only one instance, and provide a global point of access to it.
Factory
Define an interface for creating objects, but let subclasses decide which class to instantiate.
Abstract Factory Pattern
Create families of related objects without specifying concrete classes
Builder Pattern
Separate construction from representation
Prototype Pattern
Create objects by cloning an existing prototype
Adapter Pattern
Convert incompatible interfaces into compatible ones
Bridge Pattern
Decouple abstraction from implementation so they can vary independently
Composite Pattern
Compose objects into tree structures to represent hierarchies
Decorator Pattern
Add responsibilities to objects dynamically
Facade
Provide a simplified interface to a complex subsystem of classes.
Flyweight Pattern
Share fine-grained objects efficiently to reduce memory usage
Proxy Pattern
Control access to another object through a surrogate
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
Command
Encapsulate a request as an object, allowing you to parameterize clients with different requests, queue them, and log them
Iterator
Provide a way to access the elements of an object sequentially without exposing its underlying representation
Mediator
Define an object that encapsulates how a set of objects interact
Memento
Capture and externalize an object's internal state without violating encapsulation, allowing it to be restored later
Observer
Define a one-to-many dependency where when one object changes state, all its dependents are notified automatically
State
Allow an object to alter its behavior when its internal state changes
Strategy
Define a family of algorithms, encapsulate each one, and make them interchangeable
Template Method
Define the skeleton of an algorithm in a base class, deferring some steps to subclasses
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
Ready to test what you've learned?
The interview simulator runs 45-minute timed sessions with real questions on AI and classic patterns.