Coding Agents & AI-Assisted Development interview questions

31 questions from the Coding Agents & AI-Assisted Development course, each with the correct answer and an explanation. Try to answer before you open the answer.

What Coding Agents Are

1. What most clearly distinguishes a coding agent from a chat assistant?

  1. It only works offline
  2. It never makes mistakes
  3. It takes actions (edits files, runs tests) and reacts to the results
  4. It replaces version control
Show answer

Answer: It takes actions (edits files, runs tests) and reacts to the results

Acting and observing in a loop is the defining feature.

Lesson: From Autocomplete to Agents

2. What does the harness do?

  1. Runs the loop: calls the model, executes its tool requests, feeds back the results
  2. Trains the model
  3. Replaces the tests
  4. Stores the model weights
Show answer

Answer: Runs the loop: calls the model, executes its tool requests, feeds back the results

The harness is the program that turns a model into an agent.

Lesson: Anatomy of a Coding Agent

3. Why does the loop end with an independent test run?

  1. Because the model cannot read files
  2. To make the run longer
  3. Tests are optional decoration
  4. The agent's own claim of success is not proof; tests are
Show answer

Answer: The agent's own claim of success is not proof; tests are

Verification should not depend on the agent's self-report.

Lesson: The Agent Loop in Action

4. Which pairing follows the rule "more autonomy, more isolation"?

  1. A fully autonomous agent with admin rights on your laptop
  2. A background cloud agent working in a sandbox on a repository copy
  3. An unreviewed agent pushing to main
  4. An agent holding production credentials
Show answer

Answer: A background cloud agent working in a sandbox on a repository copy

Isolation limits the damage an autonomous agent can do.

Lesson: Where Agents Run: Editor, Terminal, Cloud and CI

The Tools That Make It Work

5. What is a repo map for?

  1. Encrypting the repository
  2. Showing the project's shape compactly so the model can choose what to open
  3. Running the tests
  4. Deleting dead code
Show answer

Answer: Showing the project's shape compactly so the model can choose what to open

A compact outline helps navigation without spending the whole context window.

Lesson: Reading and Searching a Codebase

6. Why does the edit tool require the old text to appear exactly once?

  1. It is a legal rule
  2. To make edits slower
  3. Because files can only contain one line
  4. To avoid changing the wrong place and to detect stale file content
Show answer

Answer: To avoid changing the wrong place and to detect stale file content

Ambiguity or absence signals the model is working from a wrong picture of the file.

Lesson: Editing Files Reliably

7. What should a test tool return to the model?

  1. A concise summary: exit code, failed tests and the first error
  2. Nothing at all
  3. Only the word "done"
  4. The entire log every time
Show answer

Answer: A concise summary: exit code, failed tests and the first error

Concise, relevant observations save context and speed up fixes.

Lesson: Running Commands and Tests, and Reading the Results

8. Why should the agent work on a dedicated branch?

  1. Main branches cannot be read
  2. Branches make the model smarter
  3. Everything it does is a reviewable, discardable diff
  4. It avoids needing tests
Show answer

Answer: Everything it does is a reviewable, discardable diff

A branch isolates the work and makes undoing it trivial.

Lesson: Git as the Safety Net and the Handoff

Context: What the Agent Knows

9. Why not always put the whole repository in the context?

  1. Because context is free
  2. Repositories cannot be read
  3. It rarely fits, costs more, is slower and buries the relevant parts
  4. Because models dislike code
Show answer

Answer: It rarely fits, costs more, is slower and buries the relevant parts

Selecting relevant material beats sending everything.

Lesson: The Context Window as a Budget

10. What belongs in an agent instruction file?

  1. Exact build/test commands, conventions, things to avoid and what "done" means
  2. The production database password
  3. The whole source code
  4. A long list of vague adjectives
Show answer

Answer: Exact build/test commands, conventions, things to avoid and what "done" means

Concrete, short guidance beats long vague text, and secrets never belong there.

Lesson: Instruction Files: Teaching the Agent Your Project

11. Which is the most reliable way to handle a very large task?

  1. Use the largest possible prompt
  2. Give it all at once and hope
  3. Remove the tests
  4. Break it into small, independently verifiable steps
Show answer

Answer: Break it into small, independently verifiable steps

Small steps keep context small and checks clear.

Lesson: Long Tasks: Compaction, Notes and Fresh Starts

12. What is a main benefit of delegating research to a sub-agent?

  1. It removes the need for tests
  2. The main context stays clean while the helper returns a short report
  3. Sub-agents are always right
  4. It makes tokens free
Show answer

Answer: The main context stays clean while the helper returns a short report

Isolation keeps noisy exploration out of the main task's context.

Lesson: Sub-Agents and Context Isolation

Working With a Coding Agent

13. Which element lets the agent (and you) know the task is done?

  1. A friendly tone
  2. A concrete way to verify, such as tests that must pass
  3. A long background story
  4. A random deadline
Show answer

Answer: A concrete way to verify, such as tests that must pass

Without a check, "done" is just the agent's opinion.

Lesson: Writing a Task the Agent Can Succeed At

14. Which agent behaviour in a test file should alarm you?

  1. Running the test suite
  2. Adding a new test for an edge case
  3. Naming a test clearly
  4. Deleting or weakening a failing assertion
Show answer

Answer: Deleting or weakening a failing assertion

Making the check easier is a classic way to fake success.

Lesson: Test-Driven Loops: Tests as the Target

15. Why ask the agent for a plan before it edits?

  1. Correcting a plan is cheap; undoing wrong code is expensive
  2. Plans make the model slower for no reason
  3. Plans replace tests
  4. Plans are required by git
Show answer

Answer: Correcting a plan is cheap; undoing wrong code is expensive

Catch misunderstandings before they turn into large diffs.

Lesson: Small Steps, Plans and Review Checkpoints

16. What is the limiting factor for running many agents in parallel?

  1. The colour of the terminal
  2. The number of available branches
  3. Your capacity to review their changes
  4. Nothing at all
Show answer

Answer: Your capacity to review their changes

Unreviewed changes are risk, however fast they were produced.

Lesson: Parallel Agents With Git Worktrees

Keeping Agents Reliable

17. Why can a hallucinated package name be dangerous?

  1. It is always blocked by Python
  2. It makes tests faster
  3. An attacker may publish a malicious package under that name
  4. It cannot be installed
Show answer

Answer: An attacker may publish a malicious package under that name

Always verify that a dependency exists and is the intended one before installing.

Lesson: How Coding Agents Fail

18. What should happen when a stuck-agent check trips?

  1. Stop and report what was tried so a human can redirect
  2. Let it continue indefinitely
  3. Delete the tests
  4. Double the budget automatically
Show answer

Answer: Stop and report what was tried so a human can redirect

Early stops save cost and surface the underlying problem.

Lesson: Detecting Stuck and Runaway Agents

19. Why re-run the same checks in CI?

  1. It avoids needing code review
  2. CI is faster than a laptop
  3. Checks only work in CI
  4. The server-side check is the authority an agent cannot skip
Show answer

Answer: The server-side check is the authority an agent cannot skip

Local harness checks can be misconfigured or bypassed; CI cannot.

Lesson: Patch Gates and Secret Scans

20. What does an agent running in your terminal inherit by default?

  1. Nothing at all
  2. Your user permissions, files and credentials
  3. Only read access to one file
  4. A separate empty machine
Show answer

Answer: Your user permissions, files and credentials

Run agents with the least privilege that lets them do the job.

Lesson: Security Basics: Permissions, Injection and Least Privilege

Measuring Agents: Quality, Cost and Value

21. Why should you build an internal benchmark besides using public ones?

  1. Public benchmarks are illegal to use
  2. Public benchmarks may not reflect your language, conventions and code quality bar
  3. Internal benchmarks need no tests
  4. Scores never matter
Show answer

Answer: Public benchmarks may not reflect your language, conventions and code quality bar

Decisions about your workflow need evidence from your own tasks.

Lesson: Benchmarks and Their Limits

22. When does a high pass@k actually help in practice?

  1. Only for tiny tasks
  2. Always, regardless of verification
  3. Never
  4. When you have a reliable verifier, such as tests, to pick the passing attempt
Show answer

Answer: When you have a reliable verifier, such as tests, to pick the passing attempt

Multiple attempts need a way to recognise the good one.

Lesson: Success Rates, pass@k and Variance

23. Why does cost rise faster than the number of steps?

  1. Each step re-sends a longer conversation as input
  2. Tokens get more expensive during the run
  3. The model charges per file
  4. It does not
Show answer

Answer: Each step re-sends a longer conversation as input

Context growth makes later steps more expensive than earlier ones.

Lesson: What a Run Costs: Context Growth and Caching

24. Which measure better reflects real value than "lines of code written"?

  1. Number of prompts sent
  2. Number of characters typed
  3. Lead time to a merged change together with defect and rework rates
  4. Time spent in the chat window
Show answer

Answer: Lead time to a merged change together with defect and rework rates

Value shows up in delivery speed and quality, not in output volume.

Lesson: Measuring Productivity and Quality Honestly

Using Agents Well in Teams

25. Where should the strongest controls on agent-written code live?

  1. Only in developers' memory
  2. Only in the agent's prompt
  3. On the server: protected branches, required reviews and CI
  4. Nowhere
Show answer

Answer: On the server: protected branches, required reviews and CI

Server-side controls apply to everyone, including agents that ignore instructions.

Lesson: Rolling Out Agents to a Team

26. Who is accountable for a bug in code an agent wrote and you merged?

  1. You and your team, as the people who accepted the change
  2. Only the AI tool
  3. Nobody
  4. The compiler
Show answer

Answer: You and your team, as the people who accepted the change

Responsibility stays with humans, which is why review matters.

Lesson: Ownership, Licensing and Accountability

27. Which habit best protects your own skills while using agents?

  1. Avoiding all tests
  2. Accepting every suggestion without reading
  3. Never using version control
  4. Asking for explanations, predicting behaviour and still writing some code by hand
Show answer

Answer: Asking for explanations, predicting behaviour and still writing some code by hand

Understanding, not typing speed, is the durable skill.

Lesson: Learning and Career: Staying the Engineer

Putting It Together

28. Why did the engineer approve the plan before the agent wrote code?

  1. Plans are required by CI
  2. Fixing a plan is cheap; undoing wrong implementation is costly
  3. Agents cannot code without permission from a manager
  4. It makes the model faster
Show answer

Answer: Fixing a plan is cheap; undoing wrong implementation is costly

Early correction prevents large wrong diffs.

Lesson: Case Study: Adding Pagination With an Agent

29. An agent reports "all tests pass" but you did not see the output. What should you do?

  1. Merge immediately
  2. Run the tests yourself or check CI; the claim is not evidence
  3. Ask the agent to say it again
  4. Delete the tests
Show answer

Answer: Run the tests yourself or check CI; the claim is not evidence

Verification must be independent of the agent's self-report.

Lesson: Revision: Cheat Sheet and Self-Check

30. You want to run three agents at once on different bug fixes. What is the right setup?

  1. One shared uncommitted working tree
  2. All three editing the same folder
  3. All three pushing directly to main
  4. A separate branch and working directory (for example a git worktree) for each, reviewed one by one
Show answer

Answer: A separate branch and working directory (for example a git worktree) for each, reviewed one by one

Isolation prevents agents overwriting each other, and review is the real limit.

Lesson: Revision: Cheat Sheet and Self-Check

31. A task run costs far more than expected. Which two causes are most likely?

  1. A long run where context grows each step, and a stuck loop without caps
  2. Tokens became free
  3. The branch name was too short
  4. Tests were too fast
Show answer

Answer: A long run where context grows each step, and a stuck loop without caps

Cap steps and cost, detect repetition, keep outputs concise and use caching.

Lesson: Revision: Cheat Sheet and Self-Check

← Back to the course