The 5 patterns are at the heart of the exam. The trap: choosing the right pattern based on context. We'll build them and observe them in action with Claude Code.
Objective: build a pipeline where each step uses the result of the previous one. This is the simplest pattern — and the one most often confused with Orchestrator.
Ask Claude to build a 3-step processing pipeline with each step clearly shown:
When tasks are sequential and dependent. The output of N is the input of N+1. Typical case: extract → transform → format. Not to be confused with Orchestrator (which delegates to sub-agents) or Parallelization (no dependency).
Objective: observe the parallelization pattern, understand fork vs fresh agent, and know when it is appropriate.
Request a parallel analysis across several independent dimensions:
Now ask it to explain fork vs fresh agent:
When tasks are independent (no dependency between them) and you want to reduce latency. Same input, N processes, N outputs. Note: don't parallelize if one task depends on the result of another.
"Fork and fresh agent are interchangeable in Parallelization" → FALSE. Fork inherits context + shares the prompt cache (cheaper). Fresh agent starts from scratch — requires a self-contained prompt, cannot see the history.
Objective: understand the routing pattern: an LLM analyzes the input and routes it to the appropriate specialized sub-agent.
Build a simple router:
When inputs are very different in nature and require specialized processing. The router is a lightweight LLM (Haiku) that classifies quickly, then delegates to the right expert (Sonnet/Opus). Reduces costs vs sending everything to a powerful model.
Objective: build an orchestrator that decomposes a complex task, delegates to sub-agents, then synthesizes. This is the most powerful pattern — and the most complex.
Ask Claude to play the role of an orchestrator:
Chaining = predefined sequential steps. Orchestrator = dynamic decomposition, the orchestrator decides the sub-tasks at runtime based on task analysis. The orchestrator can also parallelize some sub-agents.
Objective: build a loop where one agent evaluates another's work and triggers improvement iterations until a quality criterion is met.
Build an evaluator-optimizer loop:
Ask for an explanation of the pattern:
When output quality is hard to guarantee in a single pass. Typical cases: code generation (tests as evaluator), writing (rubric as evaluator), translation (back-translation). The cost is higher — multiple iterations.
"The evaluator and the generator must be the same model" → FALSE. The evaluator can be lighter (Haiku) if criteria are simple, or more powerful (Opus) if evaluation is complex. It can also be a deterministic tool (test suite, linter).