InterviewKata
AI engineering · Module 20a · Level 5: Production

When to use which: paradigms and architectures

The track teaches several ways to work with agents (vibe coding, intent briefs, specs, test-driven loops) and several ways to build them (a single agent, routers, plan-and-execute, supervisors, handoffs, human gates). This module puts the choices in one place. Two questions decide almost everything: how much rigor does this job need, and what shape is the work? Each recommendation below points to a case study where a real team made that choice, or paid for not making it.

A 3-minute conversation: Sam asks, Priya explains
0:00 / 3:15

1. Two separate decisions

Planning a journey. How carefully you plan depends on the stakes: a walk to the shops needs no plan, a flight with a connection needs a checked itinerary. How you travel depends on the route: one car for one trip, a coach that drops groups at different stops, a relay for a long expedition. Careful planning and the choice of vehicle are separate questions; mixing them up gets you a detailed itinerary for a walk, or a coach for one person.
DecisionDecided byOptionsTaught in
Rigor (paradigm)How long the code lives, what a mistake costs, whether "correct" can be checkedVibe, intent brief, spec-driven, test-driven08c, 08a
Shape (architecture)Whether the work splits into categories, independent parts or known steps, and what's irreversibleSingle agent, router, plan-and-execute, supervisor, handoffs, human gates07a, 16a
Context (always)Every jobInstructions up front, just-in-time retrieval, compaction, notes, subagents05a

2. The decision guide

Rigor: which paradigm?

If the job is…UseBecause (case)
Short-lived, low stakes, yours aloneVibe codingSpeed is the point; nothing depends on it. Never near production data: C05 Replit
Going to ship, path still openIntent brief, then the agent's planCheap; the plan review catches misunderstandings (08c)
A feature across many files in a codebase with conventionsSpec-drivenReviewed before code exists (08a)
High stakes, correctness checkableSpec plus tests written firstBuilds and tests judge every edit: C10 Google
High stakes, hard to check automaticallySpec plus human review and evalsJudges and guardrails catch what tests can't: C09 DoorDash
Answers customers rely onGrounded answers with citations, and refusalsThe company owns what its bot says: C03 Air Canada

Shape: which architecture?

If the work…UseBecause (case)
Is one coupled piece (a feature, a document)Single agent, with compaction for long runsSplit agents make conflicting decisions: C12 Cognition
Falls into a few clear request typesRouter (or handoffs if users talk to each specialist)Each specialist gets only its prompt and tools (07a)
Has many independent parts and a valuable answerSupervisor with parallel subagents90.2% better on broad research, at about 15× a chat's tokens: C11 Anthropic
Has steps you can list, and must be thoroughPlan-and-execute"ReAct alone is not sufficient for an enterprise-grade agent": C13 LinkedIn
Includes irreversible or accountable actionsHuman gates in the tools, plus environments the agent can't reachC05 Replit; recruiters approve decisions they own in C13
Is judged by business outcomesMeasure outcomes, not launch numbersC08 Klarna

3. Common jobs on the map

Rigor across the top, shape down the side. Each cell names a typical job and its case study.

Low rigor (vibe, intent)
Medium rigor (spec)
High rigor (spec + tests, review)
Single agent
Prototype, one-off script
Feature in an existing codebase 08a
Checkout or payments change C12
Router / handoffs
Internal FAQ helper
Support desk across topics 07a
Customer refunds with gates C03 C09
Plan-and-execute
Personal automation
Data pipeline tasks
Hiring workflow with approvals C13
Supervisor
Quick survey of options
Weekly research report C11
Research a decision rests on, with human review C11

Some jobs need no agent architecture at all. Google's large code migrations run as a fixed pipeline: tools find the code, the model edits, builds and tests judge, people review. The authors found LLM planning "often not needed" (C10). A workflow you can write down beats an agent that has to work it out.

One product, from prototype to production

4. Try it yourself

5. The guide in code

The two decisions as two small functions, run on five jobs. Each prints its rigor level, its architecture, and the case studies behind them. The program was run in all three languages; each prints the output below it.

# Each job described by the same questions.
JOBS = [
    ("one-off data clean-up script", dict(ships=False, high_risk=False, checkable=True, categories=False,
                                          independent=False, steps_known=False, irreversible=False)),
    ("customer refund assistant", dict(ships=True, high_risk=True, checkable=True, categories=True,
                                       independent=False, steps_known=True, irreversible=True)),
    ("weekly market research report", dict(ships=True, high_risk=False, checkable=False, categories=False,
                                           independent=True, steps_known=False, irreversible=False)),
    ("checkout feature in an existing app", dict(ships=True, high_risk=True, checkable=True, categories=False,
                                                 independent=False, steps_known=False, irreversible=False)),
    ("hiring workflow agent", dict(ships=True, high_risk=True, checkable=False, categories=False,
                                   independent=False, steps_known=True, irreversible=True)),
]


def paradigm(j):
    """How much rigor: follows how long the code lives and what a mistake costs (Module 08c)."""
    if not j["ships"] and not j["high_risk"]:
        return "vibe", []
    if j["high_risk"] and j["checkable"]:
        return "spec + test-driven", ["C10"]
    if j["high_risk"]:
        return "spec + human review", []
    return "intent brief", []


def architecture(j):
    """What shape: follows the structure of the work (Module 07a)."""
    if j["categories"]:
        shape, cases = "router", []
    elif j["independent"]:
        shape, cases = "supervisor", ["C11"]
    elif j["steps_known"]:
        shape, cases = "plan-and-execute", ["C13"]
    else:
        shape, cases = "single agent", ["C12"]
    if j["irreversible"]:
        shape, cases = shape + " + human gates", cases + ["C05"]
    return shape, cases


for name, job in JOBS:
    (p, pc), (a, ac) = paradigm(job), architecture(job)
    cases = sorted(set(pc + ac))
    print(f"{name}:")
    print(f"    {p} / {a}" + (f"   (see {', '.join(cases)})" if cases else ""))
type Job = { ships: boolean; highRisk: boolean; checkable: boolean; categories: boolean; independent: boolean; stepsKnown: boolean; irreversible: boolean };

// Each job described by the same questions.
const JOBS: [string, Job][] = [
  ["one-off data clean-up script", { ships: false, highRisk: false, checkable: true, categories: false, independent: false, stepsKnown: false, irreversible: false }],
  ["customer refund assistant", { ships: true, highRisk: true, checkable: true, categories: true, independent: false, stepsKnown: true, irreversible: true }],
  ["weekly market research report", { ships: true, highRisk: false, checkable: false, categories: false, independent: true, stepsKnown: false, irreversible: false }],
  ["checkout feature in an existing app", { ships: true, highRisk: true, checkable: true, categories: false, independent: false, stepsKnown: false, irreversible: false }],
  ["hiring workflow agent", { ships: true, highRisk: true, checkable: false, categories: false, independent: false, stepsKnown: true, irreversible: true }],
];

// How much rigor: follows how long the code lives and what a mistake costs (Module 08c).
function paradigm(j: Job): [string, string[]] {
  if (!j.ships && !j.highRisk) return ["vibe", []];
  if (j.highRisk && j.checkable) return ["spec + test-driven", ["C10"]];
  if (j.highRisk) return ["spec + human review", []];
  return ["intent brief", []];
}

// What shape: follows the structure of the work (Module 07a).
function architecture(j: Job): [string, string[]] {
  let shape: string, cases: string[];
  if (j.categories) [shape, cases] = ["router", []];
  else if (j.independent) [shape, cases] = ["supervisor", ["C11"]];
  else if (j.stepsKnown) [shape, cases] = ["plan-and-execute", ["C13"]];
  else [shape, cases] = ["single agent", ["C12"]];
  if (j.irreversible) [shape, cases] = [shape + " + human gates", [...cases, "C05"]];
  return [shape, cases];
}

for (const [name, job] of JOBS) {
  const [p, pc] = paradigm(job), [a, ac] = architecture(job);
  const cases = [...new Set([...pc, ...ac])].sort();
  console.log(`${name}:`);
  console.log(`    ${p} / ${a}` + (cases.length ? `   (see ${cases.join(", ")})` : ""));
}
import java.util.*;

public class Main {
    record Job(String name, boolean ships, boolean highRisk, boolean checkable, boolean categories, boolean independent, boolean stepsKnown, boolean irreversible) {}
    record Pick(String choice, List<String> cases) {}

    // Each job described by the same questions.
    static final List<Job> JOBS = List.of(
            new Job("one-off data clean-up script", false, false, true, false, false, false, false),
            new Job("customer refund assistant", true, true, true, true, false, true, true),
            new Job("weekly market research report", true, false, false, false, true, false, false),
            new Job("checkout feature in an existing app", true, true, true, false, false, false, false),
            new Job("hiring workflow agent", true, true, false, false, false, true, true));

    // How much rigor: follows how long the code lives and what a mistake costs (Module 08c).
    static Pick paradigm(Job j) {
        if (!j.ships() && !j.highRisk()) return new Pick("vibe", List.of());
        if (j.highRisk() && j.checkable()) return new Pick("spec + test-driven", List.of("C10"));
        if (j.highRisk()) return new Pick("spec + human review", List.of());
        return new Pick("intent brief", List.of());
    }

    // What shape: follows the structure of the work (Module 07a).
    static Pick architecture(Job j) {
        Pick p;
        if (j.categories()) p = new Pick("router", List.of());
        else if (j.independent()) p = new Pick("supervisor", List.of("C11"));
        else if (j.stepsKnown()) p = new Pick("plan-and-execute", List.of("C13"));
        else p = new Pick("single agent", List.of("C12"));
        if (j.irreversible()) {
            List<String> cases = new ArrayList<>(p.cases());
            cases.add("C05");
            p = new Pick(p.choice() + " + human gates", cases);
        }
        return p;
    }

    public static void main(String[] args) {
        for (Job job : JOBS) {
            Pick p = paradigm(job), a = architecture(job);
            TreeSet<String> cases = new TreeSet<>(p.cases());
            cases.addAll(a.cases());
            System.out.println(job.name() + ":");
            System.out.println("    " + p.choice() + " / " + a.choice() + (cases.isEmpty() ? "" : "   (see " + String.join(", ", cases) + ")"));
        }
    }
}
one-off data clean-up script:
    vibe / single agent   (see C12)
customer refund assistant:
    spec + test-driven / router + human gates   (see C05, C10)
weekly market research report:
    intent brief / supervisor   (see C11)
checkout feature in an existing app:
    spec + test-driven / single agent   (see C10, C12)
hiring workflow agent:
    spec + human review / plan-and-execute + human gates   (see C05, C13)

6. Remember it

Memory hook: "Rigor follows risk; shape follows the work"Decide how careful to be from what a mistake costs. Decide the architecture from how the work splits. Never let one decide the other.
How this hook works: what “Rigor follows risk; shape follows the work” means

The story → the concept

JourneyAgent work
How carefully you planRigor: vibe, intent, spec, test-driven
Walk to the shopsVibe coding a one-off
A checked itinerary for a connecting flightSpec plus tests for a payments change
One carA single agent
A coach dropping groups at stopsA router
A relay for a long expeditionPlan-and-execute, or a supervisor with parallel teams

The trap it saves you from

Picking the impressive option on both axes, a full spec and five agents, for work that needed a sentence and one agent; or the reverse, vibe coding the payments service.

7. Mismatches to avoid

Vibe rigor on production stakesA prototype that quietly ships, or an agent with production credentials in an experiment (C05).
A supervisor on coupled workParallel agents building one connected thing make conflicting decisions (C12).
Full spec for a one-line changeRigor costs time; match it to the stakes.
Gates on everythingApproval fatigue means nobody reads. Gate what's irreversible or accountable.
Tests without protectionA test-driven loop where the agent can edit the tests is vibe coding with extra steps (08c).
Choosing by frameworkPick the shape first; the framework only implements it (07a).

8. Hands-on lab (roadmap week 22)

  1. Classify your work: list five AI-assisted jobs from your team and place each on the map.
  2. Find a mismatch: one job where today's rigor or shape doesn't fit. What would you change?
  3. Cite a case: for each choice, name the case study that supports it, or admit it's a hunch.
  4. Write the guide: a one-page version of this module for your team's AGENTS.md or wiki.

9. Self-check quiz

What should decide the rigor level?

Rigor follows risk; the architecture follows the work.

A payments change in an existing codebase, fully testable. Which combination?

High stakes and checkable: tests first. One coupled piece: one agent (C10, C12).

A weekly research report covering twelve independent markets. Which architecture?

Independent parts and a valuable answer: the case Anthropic built for (C11).

An agent that runs a multi-stage approval workflow, with decisions people must answer for. Which architecture?

Known steps, thoroughness, accountable decisions (C13).

10. Go deeper

ResourceTimeWhy
Module 07a: Agent architectures45 minEach architecture in depth, with frameworks.
Module 08c: Rigor levels40 minEach paradigm in depth, with a test-first loop.
Module 05a: Context engineering for agents40 minWhat every job needs, whatever its shape.
Cases C11, C12, C131 hThree teams, three architectures, and why.