AI Engineer Interview Question

When would you build an agent rather than a fixed chain of LLM calls?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Use a fixed workflow when the steps are known in advance, because it is cheaper, faster, easier to test and fails predictably. Reach for an agent when the path genuinely depends on what the model discovers along the way, such as open ended research or debugging, and the task tolerates some variability. Even then, cap the number of steps, limit the tools, trace every decision, and keep a human approval for consequential actions.

Why interviewers ask this

Agents are fashionable, and the interviewer wants to see that you pick the simplest architecture that solves the problem rather than the most impressive one. They listen for honest trade offs: agents cost more, run slower, are harder to evaluate and can loop or wander. Describing a middle ground, such as a workflow with a single model driven routing step, shows that you design for reliability rather than for the demo.

How to structure your answer

  • Define the difference: steps fixed in code versus chosen by the model.
  • Give your default and the reasons for it.
  • Name the problems that genuinely need an agent.
  • Describe the controls you would put around one.

Example answer

Spoken example, first person

My default is a workflow, meaning I decide the steps in code and the model fills in each one. If a support request always goes classify, retrieve, draft, check, then hard coding that sequence gives me predictable latency and cost, and I can test each step on its own. An agent, where the model decides what to do next in a loop, earns its place when the path cannot be known in advance. Investigating a failed deployment is a good example, because what you look at next depends on what you just found. The price is real. Agents use more tokens, take longer, are much harder to evaluate because every run differs, and they can loop. So I often land in between, a workflow with one model driven routing step, which gets most of the flexibility with little of the risk. When I do build an agent, it gets a step limit, a small tool set, a budget per run, full tracing, and a human approval before anything irreversible. I would rather ship a boring workflow that works every time.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • How would you evaluate an agent when every run takes a different path?
  • What would you do if the agent keeps calling the same tool in a loop?
  • How do you decide where to put a human approval step?

Related ai engineer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot