How would you separate code understanding, code generation, and code execution in an agent?

Instruction: Describe the main phases of a coding-agent workflow.

Context: Checks whether the candidate can explain the core concept clearly and connect it to real production decisions. Describe the main phases of a coding-agent workflow.

Updated

Example Answer

I'd give each stage a clear input and output. Understanding produces an evidence map and proposed behavior. Generation produces a patch against a known commit. Execution runs approved checks against that patch in an isolated environment.

For a billing fix, the agent may inspect the calculation and propose changing rounding, but that does not authorize running a production migration. The executor checks the command, environment, and permissions independently. These stages can iterate without needing three separate models or services. If a run fails, I can distinguish wrong evidence, a bad diff, and a blocked or failed command. The tradeoff is extra coordination, so I'd keep the artifacts small and only separate boundaries that actually need different controls.

Why this works

Separates responsibilities without prescribing unnecessary architecture or confusing a generated command with authority.

Practice follow-up

What should return to the generation stage after a test-runner environment failure?

Your preparation path

Work through these questions in order. Read the answer aloud, then explain it in your own words.

Related Questions