The agent keeps inventing APIs that do not exist in the codebase. What would you change first?

Instruction: Describe how you would respond when a coding agent hallucinates local interfaces.

Context: Tests how the candidate diagnoses the problem, chooses the safest next step, and reasons through recovery. Describe how you would respond when a coding agent hallucinates local interfaces.

Official answer available

Preview the opening of the answer, then unlock the full walkthrough.

I would strengthen grounding before generation. Invented APIs usually mean the agent is relying on language priors instead of repository evidence when it chooses how to implement the change.

I would improve symbol lookup, expose existing interface definitions more clearly, and require the...

Related Questions