The candidate opens the pull request. The title says "Add order history endpoint, invoice download, and admin refunds". The description says "Tested locally, all green." The Run tests button agrees. Somewhere in the diff, a customer can download another customer's invoice, page 1 of order history silently skips the newest orders, and a failed refund leaves the ledger saying the money went back when it did not.
Forty minutes later you have their review. Did they find all three? Did they spend ten minutes on a variable name first? Did they prove the invoice leak with a request, or write "this might be insecure"? And the question that matters most for a senior hire: would you want this person reviewing your juniors' code every day?
This post is for engineering managers hiring mid-level and senior developers: how to build that pull request, how to run the session, what to watch, and a rubric for your next loop.
Why a pull request beats a blank file
Senior developers spend much of their week reading code, not writing it from scratch. They review teammates' changes and decide what ships. A blank-file exercise tests whether someone can produce a correct function under a clock, which a mid-level developer and a good AI assistant can both do. A review task tests the judgment a senior engineer is paid for:
- What they notice. Bugs that pass the tests are the ones that reach production.
- What they rank first. A security hole and a naming nit are both "comments". Only one should block the merge.
- Whether they check. A senior engineer turns a suspicion into a reproduction before asking a colleague to rework a branch.
- How they say it. Correct but cutting comments teach juniors to stop opening pull requests.
That last point is not soft. Google's published review guidance has a whole page on how to write review comments: be courteous, explain your reasoning, comment on the code and not the developer. It is part of the job, so it belongs in the interview.
Why the repo has to run
You can run a review interview from a diff pasted into a document, but you lose the best signal. On paper, a candidate who suspects the pagination is off by one can only say so. In a running repo, they can request page 1 and see the newest orders missing. That move from "I think" to "here is the request that shows it" separates a reviewer who blocks merges on evidence from one who blocks them on hunches.
In EasyEnv, the pull request lives in a real git repository on a box provisioned for the candidate: repo checked out, feature branch ready, database seeded, service started with one command. The candidate reads the diff with git diff main...feature/order-history or in the editor, runs the suite with Run tests, and pokes the service with curl. The session is recorded, so the review you read comes with the work that produced it.
The pull request: three real bugs and two style nits
Here is the PR we would build for a backend role. Swap the stack for yours. A small orders service gets three features in one branch: a paginated GET /orders, a GET /orders/{id}/invoice download, and an admin POST /orders/{id}/refund. All tests pass, including the PR's new ones, because they only check what the author thought to check.
Bug 1: off by one in pagination
The API docs number pages from 1, but the handler computes offset = page * page_size, so page 1 skips the first page of results. The new test requests page 2 and only asserts the item count.
Found and proved: the candidate checks where pages start, requests ?page=1 against the seeded data, and compares it with a direct query. Seed enough orders that the gap is obvious.
Bug 2: a new endpoint without the ownership check
Every existing order route uses a require_owner dependency. The new invoice route is registered without it, so any signed-in user can fetch any invoice by changing the id. Broken access control like this is first in the OWASP Top 10.
Found and proved: the candidate notices the pattern missing, signs in as the second seeded user, requests the first user's invoice, and gets a 200.
Bug 3: a refund that does not roll back
The handler writes a ledger entry and commits, then calls the payment provider. If the call fails, it logs and returns 502, but the ledger row is already committed. The books say the customer was refunded. They were not.
Found and proved: the candidate sees the commit and the external call are not one unit of work. The box ships a provider stub that fails when an environment variable is set, documented in the README as a real repo would. The strong candidate sets it, calls the refund, and shows the ledger row that should not exist.
Two style issues that should not block
A variable named res2 next to a res that is never used again, and imports out of the formatter's order. Both deserve at most a light comment. They are there to see where they land in the list. A reviewer whose first three comments are about res2 while the invoice leak sits further down is showing you how they will spend your team's review time.
How to build the pull request
- Start from a real service shape. A small version of something your team runs, so a missing pattern stands out.
- Take the bugs from your own history. Each should be a class of bug your team has shipped or nearly shipped. It also gives you a story for the debrief.
- Make the tests pass. The exercise is about what tests do not catch.
- Make every bug observable. Two users, enough orders to cross a page boundary, the failing provider stub. A bug that can only be argued about cannot be scored on verification.
- Write a plausible PR description. Slightly confident, mentions local testing, no hints.
- Keep the diff readable in twenty minutes. Otherwise you are testing reading speed. Cut features before you cut bugs.
- Run it on a colleague first. If a trusted engineer misses a bug because of your setup, fix the setup, not the rubric.
A 50-minute time plan
| Time |
What happens |
| 0 to 5 min |
Read the PR description and brief, start the service |
| 5 to 30 min |
Read the diff, run tests, reproduce suspicions |
| 30 to 40 min |
Write the comments they would post, in priority order, with a merge verdict |
| 40 to 50 min |
Debrief: walk through the top comment, then rewrite one for a junior author |
The brief says: "Review this as if a teammate opened it. Write the comments you would actually post. Tell us whether it can merge." Do not say how many bugs there are. Comments go in a REVIEW.md in the repo or a written answer.
Keep the debrief even if the rest is asynchronous. Ask: "The author joined three months ago. Rewrite your refund comment for them." Some candidates soften it into mush. Some stay precise and add the why. The second kind is who you want reviewing juniors.
What to watch in the session recording
The review tells you what they concluded. The recording tells you how.
- Whether claims have reproductions. If the review says "page 1 skips results", look for the
curl that showed it. No request means the claim was not checked, even if it is right.
- What they did with green tests. Pressing Run tests and moving on is fine. Writing "tests pass, LGTM" is not.
- Time on the nits. It is visible, and it matches what they will do on your team.
If two interviewers score the session, have them score before they talk. On EasyEnv, each interviewer's vote stays hidden until every interviewer has voted, so the first confident opinion does not set everyone else's. Tone is exactly where one strong voice tends to anchor a panel.
A rubric for the code review interview
Score each row 1 to 4, with one sentence of evidence from the session or the review.
| Area |
1 |
2 |
3 |
4 |
| Finding |
None of the three bugs |
One |
Two |
All three |
| Priority |
Nits first, bugs buried |
Mixed, no verdict |
Bugs above nits, blocks the merge |
Ranked by impact, nits marked non-blocking |
| Verification |
Ran nothing |
Ran the tests only |
Reproduced at least one bug |
Reproduced every bug reported, command in the comment |
| Tone |
Dismissive or personal |
Correct but curt |
Clear, explains the why |
Clear, explains the why, suggests a fix, would teach a junior |
| Scope |
Rewrote the feature in comments |
Asked for unrelated changes |
Kept to the PR |
Kept to the PR, follow-ups as separate issues |
For a senior hire, look for 3 or more in priority, verification and tone. All three bugs with a 1 in tone is a no for a role that reviews other people's code. Two bugs with careful reproductions and an exact, kind comment is often a stronger signal than three flagged on a hunch. See how to write a technical interview rubric for anchoring scores so interviewers agree, and the practical interview scorecard for rolling them into a decision.
AI-written code, and AI during the review
This exercise reviews a colleague's pull request. Reviewing code a model wrote has different failure modes, such as confident code nobody on the team understands, covered in how to review AI-generated code.
Whether candidates may use an AI assistant during the review is your call. If you allow it, expect the missing ownership check to be spotted quickly. The signal moves to what a model cannot do for them: proving the bug on the running service, deciding what blocks the merge, and writing the comment a person will read.
Where this interview falls short
It does not show how someone designs a system from nothing, or handles a disagreement that goes three rounds. Pair it with a design conversation, or ask about the last review where they changed their mind. It also favours candidates who know your stack; if you hire across languages, offer the PR in two stacks or read verification speed with that in mind.
Try it on your next loop
Take the last bug your team caught in review, or the last one that slipped through. Put it in a branch with two others and a couple of harmless nits, make the tests green, and hand it to your next senior candidate with a running service behind it.
What is the bug your team keeps approving because the tests were green?