Scrivio Interview library
LeadershipIntermediate6 min read · updated 12 November 2026

Your team adopted AI coding assistants. Pull requests got bigger, review quality dropped and two production bugs came from generated code nobody fully understood. What changes would you make as the tech lead?

I would not ban the assistants; I would restore the conditions that make review work. Pull requests stay small, and the author must be able to explain and owns every line, generated or not. Automated checks get stronger: tests, static analysis, mutation testing for critical modules and security scanners. The team agrees where assistants help most (boilerplate, tests, migrations) and where extra care is needed (security, concurrency, money). We measure defect rate, review time and rework instead of lines produced, and share prompts and practices, pairing on difficult changes.

Why this question is asked

This situation is becoming common. Assistants make it easy to produce a lot of code quickly, so pull requests grow, reviewers skim what they cannot fully read, and code that nobody truly understands reaches production. Two incidents later, the team is tempted either to ban the tools or to ignore the problem. Interviewers ask this leadership question to see whether a tech lead can find the real cause and fix the process without losing the productivity gains. In this answer, we will look at what actually went wrong, then go through ownership and pull request size, automated checks, where assistants fit, how to measure, and how to spread good practice, with an example of how the changes play out.

1What Actually Went Wrong

It helps to be precise about the cause, because it is not the tool itself. Code review works when the reviewer can hold the change in their head, usually a few hundred lines with a clear purpose. Assistants broke that assumption in two ways. Authors produced much larger changes, because generating code felt cheap. And authors sometimes did not fully understand what they submitted, so the review was the first time anyone thought carefully about it, and that review was rushed because the change was large.

The two production bugs are the result of that combination: code nobody fully understood passed a review nobody could do properly. So the fixes have to restore understanding by the author and make review possible again, with automation catching what humans miss.

Step throughHow the bugs reached production
  1. Assistant generates a large change quickly
  2. Author submits without fully understanding it1,200-line pull request
  3. Reviewer skims, cannot hold it in their head
  4. Tests mirror the implementationthey pass, but check little
  5. Subtle bug ships to production

5 steps in order. Play them, or step through them one at a time.

Each step removed one layer of understanding.

2Small Pull Requests and Full Ownership

The first change is a clear team agreement: the author owns every line, however it was produced. In practice that means the author can explain why each part is there and what happens in its failure cases, and the pull request description says what was generated and what was checked. A reviewer who asks why is this here and gets I don't know, the assistant wrote it, sends the change back. This is not about blame; it is the same standard we always had, made explicit because the tool made it easy to slip.

The second is size. We agree on a soft limit, for example around 400 changed lines excluding generated files such as migrations or snapshots, and ask for larger work to be split into reviewable steps. Smaller changes are faster to review in total, and they make it obvious when something does not belong.

3Stronger Automated Checks

Humans should not be the only defence, especially against the subtle mistakes generated code tends to contain. We raise the automated bar: unit and integration tests are required for behaviour changes, static analysis (for example SpotBugs, Error Prone or Sonar rules) runs on every pull request, and dependency and security scanners catch vulnerable libraries and obvious injection patterns.

For critical modules, such as payment calculation or permission checks, we add mutation testing with a tool like PIT. Mutation testing changes the code in small ways, flipping a condition or removing a call, and checks whether a test fails. Generated tests that only mirror the implementation tend to let many mutants survive, so a low mutation score is a clear signal that the tests check little, which is exactly the weakness we saw.

XML
<!-- pom.xml: mutation testing for the billing module only, run in CI -->
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<configuration>
<targetClasses><param>com.example.billing.*</param></targetClasses>
<mutationThreshold>75</mutationThreshold> <!-- build fails below 75% killed mutants -->
</configuration>
</plugin>
<!-- report: 142 mutants, 118 killed, 83% -->

4Agreeing Where Assistants Help and Where Care Is Needed

Assistants are not equally good at everything, and the team should say so out loud. They are strong at boilerplate (DTOs, mappers, configuration), first drafts of tests, routine migrations and explaining unfamiliar code. They are weakest, and mistakes are most expensive, in security-sensitive code, concurrency, money calculations and complex domain rules. For those areas we agree on extra care: the author writes or closely rewrites the code, a second reviewer with domain knowledge is required, and tests are written from the requirements first.

Writing this down as a short team guide turns individual judgement into a shared standard, and gives reviewers something to point to.

Team guide for assistant use
AreaAssistant useExtra safeguards
DTOs, mappers, configurationEncouragedNormal review
TestsDrafts encouragedAuthor checks they test behaviour
Schema and code migrationsEncouragedRun on a copy of production data
Security and authorizationCarefulSecond reviewer, security checklist
ConcurrencyCarefulDesign note, stress test
Money and billingCarefulMutation testing, domain reviewer

5Measuring Outcomes, Not Output

If we measure lines produced or pull requests merged, assistants look like a huge win, and the problems stay hidden. We measure what matters: defect rate (bugs found after merge, especially in production), review time per pull request, rework (changes that are reverted or fixed within a few weeks), and lead time from first commit to production. We compare the period before the changes with the months after, and discuss the numbers in retrospectives.

An example of how this might play out: the team adopts the size limit and ownership rule, PIT on billing and a second reviewer for security code. Over the next quarter, average pull request size drops from about 900 lines to 300, review time per pull request falls even though there are more of them, and production bugs traced to recent changes go down. That is the evidence that the team can keep the tools and the quality.

6Sharing Practice and Pairing

Finally, we spread what works. A short regular slot in the team meeting where someone shows a prompt or workflow that worked, or a mistake an assistant made, builds shared judgement quickly. We keep useful prompts in the repository, such as how to ask for a test that covers edge cases or for a migration in our style.

For difficult changes, pairing works better than review after the fact: two engineers, one assistant, discussing each suggestion as it appears. Juniors in particular learn more this way than by accepting suggestions alone, and seniors see where the tool misleads people.

7Follow-up questions

Would you consider banning assistants after the incidents?

No. The incidents came from process gaps the tools exposed, not from the tools alone, and a ban would lose real productivity and push use underground. Fixing ownership, review size and automated checks addresses the cause; if the measurements did not improve, I would revisit the guidelines, not reach for a ban first.

How do you handle a developer who keeps submitting large generated changes?

Privately and concretely: show them the review data and an example where the size hid a problem, agree on how to split their next feature, and pair with them once. Most people adjust quickly when they see the reason and get help.

Should the pull request say which code was generated?

A short note helps reviewers decide where to look harder, and it builds a habit of reflection. But it should not change the standard: generated or not, the author must understand it and the code must pass the same checks.

8Conclusion

In this answer, we saw that the problems came from large pull requests and code the authors did not fully understand, not from the assistants alone. As tech lead, I would keep pull requests small and make authors own and explain every line, strengthen automated checks with tests, static analysis, mutation testing on critical modules and security scanners, agree where assistants help and where extra care is needed, measure defect rate, review time and rework instead of output, and spread good practice through shared prompts and pairing.

What to say in the interviewAbout 80 seconds aloud

Open with

I would first name the real cause: assistants made large changes cheap to produce, authors sometimes submitted code they did not fully understand, and reviewers could not properly review 1,000-line pull requests, so the bugs passed two weak checks.

Then, if they want more

I would not ban the tools. I would agree with the team that the author owns every line, generated or not, and must be able to explain it, and set a soft limit of around 400 changed lines so reviews are real again.

I would strengthen automation: tests required for behaviour changes, static analysis and security scanning on every pull request, and mutation testing with PIT on critical modules like billing, because generated tests often mirror the implementation and mutation testing exposes that.

We would write a short guide on where assistants help most, boilerplate, test drafts, migrations, and where extra care is needed, security, concurrency and money, with a second reviewer there. I would measure outcomes, defect rate after merge, review time, rework and lead time, not lines or pull requests, and compare before and after.

And I would spread good practice with short demos of prompts that worked and mistakes the tool made, and pairing on difficult changes, which is also how juniors keep learning.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring AI reference
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your team adopted AI coding assistants. Pull requests got bigger, review quality dropped...": https://scrivio-interview-library.netlify.app/spring-boot/llm-fundamentals/c9f95db863/