Code Review Practices

Effective code reviews evaluate correctness, maintainability, security, and consistency while keeping feedback actionable. For a Java backend engineer, a good review balances technical rigor with delivery speed and focuses on risks that automated tools cannot reliably catch.

Code review is a structured peer check performed before code is merged. Reviewers examine whether the implementation satisfies its requirements and whether it fits the surrounding system. Typical review areas include behavior, error handling, concurrency, API design, data access, security, performance, readability, and tests.

A useful review starts with correctness and then considers maintainability and operational impact. For Java backend code, reviewers commonly inspect exception handling, transaction boundaries, nullability, thread safety, resource management, SQL behavior, dependency usage, and whether tests cover important behavior. Static analysis, formatting tools, and automated tests should handle routine checks so human reviewers can spend time on design and risk.

Feedback should be specific, actionable, and proportional to the issue. A reviewer can distinguish blocking defects from suggestions about style or future improvement. Comments should explain the technical concern and, when useful, suggest a concrete alternative rather than simply stating that the code is wrong.

The author remains responsible for resolving review feedback, while the reviewer is responsible for identifying meaningful risks. Large changes are harder to review accurately, so small, focused pull requests generally make review more effective. Teams should also avoid using review as a substitute for automated testing, architectural discussion, or ownership of production behavior.

Key points

Interview questions

What makes a code review effective?

An effective review is focused enough that the reviewer can understand the change and verify its important behavior. The feedback is concrete, respectful, and tied to a technical reason or requirement. Automated checks should cover formatting, compilation, tests, and other repeatable rules where possible. The review should identify meaningful risks without turning every personal preference into a required change.

What do you look for when reviewing a backend pull request?

I first verify that the implementation matches the intended behavior and handles important error cases. Then I check tests, readability, API usage, data access, security, and resource handling. For Java code, I pay attention to exception handling, null-related behavior, thread safety, and transaction boundaries when relevant. I also distinguish defects from optional improvements so the review remains focused.

How do you decide whether a review comment should block a pull request?

I would block when the issue can cause incorrect behavior, security exposure, data loss, serious reliability problems, or a clear violation of an important contract. A concern that improves readability or suggests a possible future refactoring is normally non-blocking. The decision should be based on impact and confidence rather than personal preference. If the concern is uncertain but potentially serious, I would explain the reasoning and discuss it with the author.

A pull request passes all tests, but you suspect a concurrency bug. What do you do?

I would inspect shared mutable state, synchronization, thread confinement, visibility guarantees, and the lifecycle of the affected objects. Passing tests does not prove that concurrent behavior is correct because race conditions can be timing-dependent. I would describe a concrete interleaving that could produce the problem and, when appropriate, request a concurrency-focused test or a safer design. I would treat a credible correctness or data-integrity risk as a blocking concern until it is resolved or explicitly accepted.

How would you improve a code review process for a growing Java backend team?

I would first establish clear ownership and review expectations, then automate low-value checks through CI. Review guidelines should prioritize correctness, security, reliability, maintainability, and architecture rather than subjective formatting preferences. I would encourage small pull requests and use lightweight checklists for recurring risks such as transactions, database queries, API compatibility, and observability. Finally, I would periodically examine recurring review findings and convert stable patterns into tests, static-analysis rules, documentation, or design guidance.