# Workflows or agents interview questions

> 6 workflows or agents interview questions for AI and ML engineer roles, each with a model answer.

Canonical: https://llmdojo.dev/interview/topic/workflows-vs-agents
Last updated: 2026-10-23

6 questions: 1 junior, 3 mid-level and 2 senior. Taught in [Workflows or Agents: Who Decides the Next Step](https://llmdojo.dev/learn/agents-harness-engineering/workflows-and-agents).

## [What's the difference between a workflow and an agent?](https://llmdojo.dev/interview/q/what-s-the-difference-between-a-workflow-and-an-agent)

Level: Junior

**Who chooses the next step.** In a workflow, predefined code paths orchestrate the model and tools. In an agent, the model directs its own process and tool use.

**Diagram: Who chooses the next step?**

1. Anthropic: workflows are systems where models and tools are orchestrated through predefined code paths. The model does steps; code decides their order.
2. Workflows offer predictability and consistency for well-defined tasks.
3. Agents are systems where the model dynamically directs its own process and tool use.
4. That suits open-ended problems where the number of steps can't be predicted, at the price of higher cost and the potential for compounding errors.

Workflows suit well-defined tasks; agents, open-ended ones where the number of steps can't be predicted.

## [Name some workflow patterns you'd try before an agent.](https://llmdojo.dev/interview/q/name-some-workflow-patterns-you-d-try-before-an-agent)

Level: Mid-level

- **Prompt chaining**: fixed steps, with checks between.
- **Routing**: classify, then a specialised path.
- **Parallelisation**: independent parts at once, or **voting** on repeated runs.
- **Orchestrator–workers**: a model splits the task and delegates.
- **Evaluator–optimiser**: generate, critique, revise.

**Diagram: Five workflow patterns**

1. Prompt chaining: a fixed sequence of calls, each working on the last one's output. Code can check the output between steps.
2. Routing: classify first, then send the input down a path built for its kind. Module 05's query routing is one example.
3. Parallelisation: split a task into independent parts run at once (sectioning), or run the same task several times and combine the answers (voting).
4. Orchestrator–workers: a model decides the subtasks at run time, so it's closer to an agent, but the structure around it is fixed.
5. Evaluator–optimiser: generate, critique, revise. Anthropic notes it works when there are clear evaluation criteria and iteration measurably helps.

## [Why separate planning from execution?](https://llmdojo.dev/interview/q/why-separate-planning-from-execution)

Level: Mid-level

So a bad plan is rejected **before** anything runs. Otherwise a plan that can't reach the goal can burn hours of calls, or perform a write you can't undo.

Validate with heuristics in code (every tool exists, under a step limit) or a model judge; regenerate on rejection.

## [Which planning failures can you catch before execution, and which can't you?](https://llmdojo.dev/interview/q/which-planning-failures-can-you-catch-before-execution-and-which-can-t)

Level: Mid-level

Catchable from the plan: an **invalid tool**, **invalid parameters**, too many steps, or a forbidden order like a refund before a policy check.

Not catchable: **wrong parameter values**, like refunding the original charge instead of the duplicate. Those values come from earlier results, so check them at call time.

## [Your agent loops “until the tests pass”. What does the harness need?](https://llmdojo.dev/interview/q/your-agent-loops-until-the-tests-pass-what-does-the-harness-need)

Level: Senior

Its own limit: maximum attempts, time and cost. When a model judges a loop's exit condition, nothing guarantees it's ever met.

In ordinary software conditions are exact; in agents the model decides them, so every loop gets a bound enforced in code.

## [How do you put people into an agent without making it useless?](https://llmdojo.dev/interview/q/how-do-you-put-people-into-an-agent-without-making-it-useless)

Level: Senior

Decide the **level of automation per action**, in advance: reads run; small refunds run; large refunds wait for approval; deletions never. Enforce it in the tool wrapper.

Approval pauses need durable state so the task resumes later. Often the best design runs a workflow for known cases and sends only the rest to an agent.

## Related
- [All interview questions](https://llmdojo.dev/interview)
