All jobs / AI engineer / AI Coding & Agentic Development
AI engineer interview question · 0–1 years
Your coding assistant’s solution imports a library you have never heard of. What do you do before you install it?
The strongest answer
Check the package really exists in the official registry, is the maintained one and has the functions the code calls — models invent plausible names, and an invented name can be registered by an attacker
Why it works
Exactly — hallucinated dependencies are a known failure, and installing an unknown package runs someone else’s code on your machine.
What a good answer covers
- Verify dependencies outside the model.
- Confirm the package exists and is maintained.
- Check the API matches the installed version.
- Never install to find out.
Answers that fall short
- Close, but not the strongest: Search for the package name to see that it exists, then install it and carry on with the task
Existing is not enough: a look-alike name can exist precisely because models keep suggesting it. Check the maintainer, the history and the API. - Weak: Ask the assistant whether the package is real; it wrote the code, so it knows what it used
The model that invented the name will usually confirm it with the same confidence. Verify outside the model. - Red flag: Install it and run the code; if the import fails I will know the package was made up
Packages can run code at install time. Trying it to see is how a squatted package lands on a laptop or a build server.
Who gets asked this
More AI Coding & Agentic Development questions
- 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…
- Your team’s coding agent keeps producing working code that ignores the codebase: a second HTTP client, a new…
- 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…