Quick revision
The short answer
Start by saying what works, then focus on the two or three issues that matter most instead of every nit, and explain the reason behind each change, for example that constructor injection makes dependencies explicit and testable. Mark clearly which changes are required and which are suggestions, offer to pair on the first tests rather than only asking for them, and follow up on the next pull requests to see whether the guidance stuck.
What to remember
In this answer, we reviewed a junior engineer's working but fragile pull request. We started with specific praise, focused on the broad catch, the missing tests and field injection, explained the reason for each with a small example, labelled required changes and suggestions, paired on the first test so the value of constructor injection became visible, and followed up on later pull requests to confirm the lessons stuck.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Start by saying what works, then focus on the two or three issues that matter most instead of every nit, and explain the reason behind each change, for example that constructor injection makes dependencies explicit and testable. Mark clearly which changes are required and which are suggestions, offer to pair on the first tests rather than only asking for them, and follow up on the next pull requests to see whether the guidance stuck.
Why this question is asked
A code review is the most frequent teaching moment in a team. Done well, it improves the code and the engineer; done badly, with forty comments and no explanation, it improves the code once and teaches the engineer to dread reviews. Interviewers ask this to see whether a senior developer can balance quality with growth. In this answer, we will look at the pull request, decide what matters, explain the reasons with code, separate required changes from suggestions, offer pairing on tests and plan the follow-up.
1The Pull Request We Are Reviewing
Here is a simplified version of what the junior engineer submitted. It works: the endpoint creates an order and returns it.
There are three real issues and probably a dozen small ones, such as naming or formatting. A review that lists all fifteen at once buries the important ones. So the first decision is what to focus on.
2Starting With What Works and Choosing the Few Things That Matter
We start the review with a genuine positive comment, for example that the endpoint is cleanly split into controller and service and the mapping from request to entity is easy to follow. It must be specific and true; generic praise reads as a formula.
Then we pick the issues with the most impact. The broad catch is the most serious, because it hides failures: a failed payment returns null, the controller probably returns a 200 with an empty body, and the log line says only 'error'. Missing tests are next, because they make every future change risky. Field injection matters too, mostly because it makes the class hard to test. Formatting and small naming points can wait, or be left to the formatter and linter.
| Comment | Impact | Label |
|---|---|---|
| catch (Exception) returns null, hides failures | wrong behaviour, lost errors | required |
no tests for create() | every change is risky | required, offer pairing |
field injection with @Autowired | hard to test, hidden dependencies | required |
method could be named createOrder | readability | suggestion |
| import order, spacing | none | leave to the formatter |
3Explaining the Reason Behind Each Change
Each required comment explains why, because the reason is what the engineer will reuse in the next class. For the catch block, we explain that catching Exception also catches programming errors and bugs, and that returning null pushes the problem to a caller who cannot know what went wrong. For injection, we explain that constructor injection makes the dependencies visible in one place, lets the fields be final, and lets a test create the class with fakes and no Spring context at all.
Notice that the comment can include a short example like this, but it should not rewrite the whole class. The engineer learns more by applying the idea than by pasting our version. A link to the team's guideline on exception handling, if one exists, helps them see it is a team standard, not our personal taste.
4Separating Required Changes From Suggestions
Junior engineers often treat every comment as an order, and they may be too shy to push back. So we label comments clearly, for example with a prefix such as 'required:' or 'suggestion:' or 'nit:', following whatever convention the team uses. Required comments must be addressed before merging; suggestions are their decision. This tells the engineer where to spend effort and shows that their judgement is trusted on the smaller points.
5Offering to Pair on the First Tests
Writing 'please add tests' to someone who has never written them for this kind of service often leads to days of struggle or a superficial test. A better comment says: 'This needs tests before merging. Would you like to pair for 30 minutes on the first one? After that the rest should be quick.' In the session, we write one unit test together, using the constructor we just introduced, and let them drive.
Notice how the injection change pays off here: the test builds the service with a lambda as a fake client in two lines. The engineer sees the reason for the earlier comment in practice, which is the kind of understanding that lasts.
6Following Up on Later Pull Requests
The real result of the review shows in the next few pull requests. If the next one uses constructor injection, handles specific exceptions and comes with tests, we say so, specifically: 'nice, the tests here caught the null case'. If the same issue appears again, we have a short, friendly conversation rather than repeating the comment, to find out whether the reason was unclear. Over a few weeks, our reviews of that engineer's work should get shorter, which is the clearest sign the feedback worked.
7Follow-up questions
Should I just fix the code myself to save time?
Only for urgent fixes. Fixing it ourselves is faster once, but the engineer learns nothing and the same issues return in the next pull request. Explaining and pairing costs more today and much less over the following months.
What if the engineer disagrees with a required change?
We discuss it, ideally in a short call rather than a long comment thread. If they have a good reason, we change our mind. If it is a team standard, we explain the reason again and point to the standard. Disagreement handled respectfully is a sign of a healthy review culture.
How many comments are too many?
There is no fixed number, but if a review has more than a handful of required changes, the pull request is probably too big or the engineer needed guidance earlier. In that case a short conversation before the next task is more useful than a long review.
8Conclusion
In this answer, we reviewed a junior engineer's working but fragile pull request. We started with specific praise, focused on the broad catch, the missing tests and field injection, explained the reason for each with a small example, labelled required changes and suggestions, paired on the first test so the value of constructor injection became visible, and followed up on later pull requests to confirm the lessons stuck.
Open with
I'd start with something specific that's good, like the clean split between controller and service, so the engineer knows the review isn't an attack. Then I'd focus on the few things that matter most, not every nit.
Then, if they want more
Here that's three: the catch of Exception that returns null, the missing tests and the field injection. For each I'd explain why. Catching everything hides bugs and turns a failed payment into a null the caller can't interpret, so I'd suggest catching only the specific exception we can handle and translating it into a meaningful error.
Constructor injection makes dependencies explicit, lets fields be final and lets a test build the class with fakes, no Spring context needed. I'd label comments clearly as required or suggestions so they know where to spend effort, and leave formatting to the tools.
For tests, instead of just writing please add tests, I'd offer to pair for half an hour on the first one, which also shows why the constructor change helps.
Then I'd watch the next few pull requests, call out when the guidance has been applied, and have a quick chat if the same issue comes back, because the goal is that my reviews of their work get shorter over time.
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 official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
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 "As a senior developer, you are reviewing a junior engineer's pull request that works but...": https://scrivio-interview-library.netlify.app/architecture/technical-leadership/5a469fd9da/