Code Review¶
Code Review Overview¶
What to Review¶
Giving Effective Feedback¶
Comment Examples¶
// BAD Comments:
"This is wrong."
"Why did you do it this way?"
"This is confusing."
"Fix this."
// ─────────────────────────────────────────────────────────────
// GOOD Comments:
"🔴 Blocker: This query runs in a loop and could cause N+1
issues with large datasets. Consider using a batch query
or join instead. Happy to pair on this if helpful."
"🟡 Suggestion: We could simplify this by using
Optional.map() here:
```java
return user.map(User::getName).orElse("Unknown");
"💬 Question: I'm curious about the decision to use a HashMap here instead of TreeMap. Is ordering not important for this use case?"
"👍 Really clean implementation of the retry logic! I like how you extracted it into a reusable component."
"🟢 Nit: Per our style guide, we typically use camelCase for variable names (userCount instead of user_count)."
---
## Code Review Workflow

---
## PR Description Template
```markdown
## Summary
[Brief description of what this PR does]
## Motivation
[Why is this change needed? Link to ticket/issue]
## Changes
- [Change 1]
- [Change 2]
- [Change 3]
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
## Screenshots
[If applicable, add screenshots]
## Deployment Notes
[Any special deployment considerations]
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No security vulnerabilities introduced
Handling Disagreements¶
Code Review Metrics¶
Senior/Staff Engineer Review Focus¶
Automating Code Review¶
Code Review Anti-Patterns¶
Building Review Culture¶
Common Interview Questions¶
- How do you approach code review?
- Check correctness, design, readability
- Focus on important issues
- Be constructive and kind
-
Balance speed and thoroughness
-
How do you handle disagreements in reviews?
- Understand their perspective
- Focus on technical merits
- Provide evidence
- Escalate if needed
-
Accept and move forward
-
What makes a good code review?
- Timely (< 24 hours)
- Thorough but focused
- Constructive feedback
- Knowledge sharing
-
Clear approval criteria
-
How do you give feedback to junior engineers?
- Explain the "why"
- Suggest alternatives
- Be patient and kind
- Recognize good work
-
Use as teaching moment
-
How do you balance review quality and speed?
- Automate style checks
- Focus on high-impact issues
- Set time expectations
- Accept "good enough"
- Small, frequent PRs