When you get a code review comment you disagree with, what do you do?
Suggested answer
Interviewers ask this to see how you work in a team, not to see whether you win arguments. A good answer shows that you can separate feelings from technical facts and that you decide based on evidence.
You can answer in four steps:
- Make sure you understand the comment first. Read it again, and if it is unclear, ask the reviewer what worries them. Many times I disagree only because I misread what they meant.
- Try what they suggest. Run the change and run the tests. The result often answers the question for you: either the comment is right and you follow it, or it breaks a specific case.
- Reply with data and end with a question. For example: "I tried this and 4 of the rejection tests went red, because '35,000' gets read as 35000 without any error. I'd like to keep the current approach. Does that sound okay to you?" The open question leaves room for the reviewer to know something you don't.
- If you are not done after two rounds, talk in person. Ten back-and-forth comments cost more time than a five-minute call. If you still can't agree, follow the team's convention or ask a third person.
Two more points are worth making. First, tell real bugs apart from personal taste: for taste, explain your reasoning but be ready to follow the team's way. Second, if a comment is right but out of scope, write it down as a separate task instead of stuffing it into the pull request under review.
Bonus points: describe one specific time you disagreed, what you tried and how it ended, even if the reviewer turned out to be right.