Code Review as a Senior Engineer: What to Look For#
When I became a team lead, I realised my reviews were mostly about style: variable names, missing semicolons, the order of imports. Useful, but a linter does that better and faster. The reviews that actually prevented incidents and taught people something looked very different.
This is the mental checklist I use now, roughly in order of importance.
1. Does this solve the right problem?#
Before reading a single line, read the ticket and the pull request description. Then ask:
- Is this the simplest approach that meets the requirement?
- Is there an existing utility, service or pattern in the codebase that already does this?
- Does the scope match the ticket, or has it grown?
The most expensive mistakes are not bugs in the implementation. They are correct implementations of the wrong design. Catching those early saves days.
2. Correctness under real conditions#
Happy paths usually work; the author tested them. I look for what happens when things go wrong:
- Null and empty inputs. What if the list is empty or the field is missing?
- Concurrency. Can two requests interleave and corrupt state? Is there a check-then-act race?
- Partial failure. If the second of three API calls fails, what state is left behind?
- Retries. Is the operation idempotent if a client retries it?
- Time. Time zones, daylight saving time, month boundaries and leap years.
1// Looks fine, but two concurrent requests can both pass the check2const count = await repo.count({ where: { userId } });3if (count >= MAX_PROJECTS) throw new ForbiddenException();4await repo.save(project);
Pointing out a race like this, with a suggested fix such as a database constraint or a lock, is worth more than fifty style comments.
3. Security#
Every change that touches input, authentication or data access gets a security pass:
- Is input validated at the boundary?
- Are queries parameterized?
- Does the endpoint check that the caller owns the resource, not just that they are logged in?
- Is anything sensitive being logged or returned to the client?
Broken access control is consistently at the top of the OWASP list for a reason: it is easy to miss in review because the code "works".
4. Operability#
Will we be able to run this in production?
- Are errors logged with enough context to debug?
- Is there a metric or trace for the new critical path?
- Can it be rolled back safely, especially if it includes a migration?
- Is it behind a feature flag if the change is risky?
5. Tests that test behavior#
I check whether the tests would fail if the code were wrong. Tests that mirror the implementation line by line break on every refactor and catch nothing. Good tests describe behavior: given this input, the user sees this result.
6. Readability for the next person#
Code is read many more times than it is written. I look for clear names, small functions with one responsibility, and comments that explain why, not what. If I needed to read a function three times to understand it, the next engineer will too.
How to give feedback#
The checklist matters, but how you deliver feedback decides whether people learn from it or resent it.
- Label severity. I prefix comments with
blocking:, suggestion: or nit:, so the author knows what must change and what is optional. - Ask, don't command. "What happens if this list is empty?" invites thinking. "This is wrong" invites defensiveness.
- Explain the reason. "Use a transaction here so the order and the payment are saved together" teaches a principle.
- Praise good work. A clean abstraction or a thorough test deserves a comment too.
- Review quickly. A pull request waiting two days blocks a teammate. I aim for a first response the same day.
Keep pull requests small#
The best predictor of review quality is pull request size. Under about 400 lines, reviewers find real problems. Above that, they skim and approve. Encourage small, incremental changes and stacked pull requests for larger features.
Conclusion#
Leave formatting to tools and spend your review time on design, correctness, security and operability. Deliver feedback with clear severity and explanations. Done well, code review is not a gate — it is how a team shares knowledge and raises its standard together.