All jobs / AI engineer / AI Coding & Agentic Development
AI engineer interview question · 3–5 years
Your team’s coding agent keeps producing working code that ignores the codebase: a second HTTP client, a new date helper that already exists, tests in the wrong framework.
What do you fix?
The strongest answer
The context it works from — a maintained project instructions file with conventions and build and test commands, pointers to exemplar files, and tasks scoped so the relevant code is actually in front of it
Why it works
Right — the agent only knows what it has read. Conventions it cannot see do not exist for it, so write them down and show examples.
What a good answer covers
- An agent knows only what it has read.
- Write conventions where the agent loads them.
- Point at exemplar files.
- Scope tasks to the relevant code.
Answers that fall short
- Close, but not the strongest: Add a line to each prompt telling it to follow existing conventions and reuse the existing helpers
It cannot follow conventions it has never been shown. Name them, and point at the file that does it properly. - Weak: Switch to a larger model; a more capable model would pick up our conventions by itself
No model has your repository’s unwritten rules in its weights. This is a context problem, not a capability problem. - Red flag: Nothing — the code works, and reviewers can clean up the duplicates some time after merge
Duplicates merged today are the examples the agent copies tomorrow, and the clean-up never gets scheduled.
Who gets asked this
More AI Coding & Agentic Development questions
- A production incident is traced to agent-written code. The author says the agent wrote it; the reviewer says…
- You want to use coding agents to move about 300 modules off a deprecated internal API. How do you run that so…
- What is the difference between an AI coding assistant and a coding agent, and why does it matter for how you…
- Your coding assistant’s solution imports a library you have never heard of. What do you do before you install…
- You are handing a feature to a coding agent. What goes into the task you write for it?
- You asked an assistant to write unit tests for an existing module. It produced forty tests, all green, and…
- A teammate’s coding agent opens one pull request: 2,400 changed lines across 45 files, mixing a rename, a…