4 exercises — write review comments that explain the issue, suggest a fix, and maintain a positive team dynamic.
0 / 24 completed
1 / 24
A junior developer wrote this code review comment: "This is wrong. Use a proper design pattern."
Which rewrite is the most professional and constructive?
Option B is the gold standard for constructive code review. It: (1) opens with a question ("Would it make sense…") to invite dialogue rather than demand compliance; (2) names the specific pattern (Strategy); (3) explains the concrete benefit (easier to add variants without modifying).
Key principle: code review comments should explain the why, not just the what. The reader should understand what problem we're solving with the suggested change. Option A is still accusatory. Options C and D are vague — they don't help the author understand what to do or why.
2 / 24
Complete the code review comment with the most appropriate phrase: "This will cause a null pointer exception when the list is empty. _____ adding a guard clause at the top: if (items.isEmpty()) return emptyResult();"
"Consider" is the ideal opening for non-mandatory suggestions — it signals that you're offering an option, not issuing a command. In code reviews, there's a spectrum from blocking to optional. A bug fix like this is blocking, but using "Consider" softens the delivery without hiding the urgency. You can also write: "I'd suggest…", "One approach would be…", or prefix with "Blocking:" for clarity.
Avoid "Why didn't you…" — it sounds accusatory and shifts the conversation from the code to the person. The code is what you're reviewing, not the developer's choices.
3 / 24
How should you write a praise comment in a code review? Which option is best?
Specific praise has much more impact than generic praise. Option C names: (1) the specific technique used (Builder pattern); (2) the specific benefit (easier to reason about and test). This teaches as well as encourages — the author learns why the approach was good, which reinforces the behaviour.
Compare to Option A ("Good.") or B ("Nice job") — vague praise feels automated. Option D mixes praise with criticism ambiguously.
Tip: aim for at least one genuine praise comment per code review. It improves team morale, signals what good looks like, and makes your critical feedback easier to receive.
4 / 24
You notice a potentially inefficient approach but you're not certain it's a problem. Which comment is most appropriate?
Option C demonstrates three expert code review practices: (1) uncertainty acknowledgement ("Curious whether…") — you're raising a concern, not stating fact; (2) specific technical reasoning (O(n²), "with large lists"); (3) psychological safety ("Happy to be wrong") — you invite the author to explain their reasoning without feeling attacked.
This approach is ideal for non-blocking performance concerns. The author may have already profiled it, or the list is always small, or there's a constraint you're unaware of. Good code reviews leave room for context the reviewer doesn't have.
5 / 24
Sarah just submitted a pull request for a new user authentication service. During the review, David leaves this comment: 'I'm not entirely sure about this implementation of rate limiting. It seems a little aggressive, and I'm concerned it might block legitimate users during peak times. Could you elaborate on your reasoning?' Which response from Sarah best addresses David's concerns while maintaining a professional tone?
The best response acknowledges David's concerns and expresses willingness to investigate. Option 1 is dismissive and unprofessional. Option 3 is confrontational and shuts down discussion. Option 2 demonstrates a collaborative approach – showing you value the feedback and are willing to make adjustments based on it. Option 4, while technically correct, doesn't address the underlying concern about potential impact.
6 / 24
Maria submitted a PR to update the user profile API. During review, John commented: 'I'm seeing a potential race condition here – if two users simultaneously try to update their avatar URLs, we might end up with corrupted data. Can you explain how this is being prevented?' Which response from Maria best addresses John's concern while maintaining a collaborative tone?
// Potential race condition during avatar updates
updateAvatar(userId, imageUrl) { ... }
The correct answer demonstrates understanding of the issue and proposes a concrete solution. Options A and D dismiss the concern without acknowledging the potential problem, which is unprofessional. Option B introduces a solution without fully explaining the context or confirming its effectiveness. Option 3 indicates an active investigation and planning for mitigation, aligning with collaborative code review practices – the ideal response in this scenario.
7 / 24
Alex submitted a pull request to refactor the payment processing module. During review, Ben left this comment: 'I'm concerned about the error handling here. It seems to just swallow exceptions without logging anything. This makes debugging extremely difficult.' Which of the following responses from Alex is most appropriate and constructive?
A. 'Thanks for the feedback, Ben. I'll add some logging.'
B. 'I've already considered this, and it's perfectly fine as it is. We don't need to log every exception.'
C. 'Okay, let's discuss the specific exceptions you're concerned about and how we can best handle them while maintaining performance. Could you provide an example?'
D. 'I disagree with your assessment; this approach is standard practice in our codebase.'
The correct answer (C) demonstrates a willingness to collaborate and understand Ben's concerns. It moves beyond simply acknowledging the feedback and instead seeks clarification on *why* Ben found the error handling problematic – specifically asking for an example. Options A and B are dismissive and don't address the root of the issue, while option D is confrontational and unproductive. A good code review response focuses on understanding the reviewer's perspective and finding a mutually agreeable solution.
8 / 24
During a code review for a new feature that calculates shipping costs, Liam left this comment: 'This calculation seems overly complex. Could we simplify it by using a pre-calculated rate based on weight and destination?' David responded with: 'I've considered the various shipping providers and their different pricing models. This approach allows us to accurately reflect all potential costs.' Which of the following is the MOST appropriate follow-up comment from Liam?
A. 'That's great, but we should still optimize for performance.'
B. 'Could you explain the rationale behind using such a complex calculation? Perhaps there's a simpler alternative that would achieve the same result.'
C. 'Okay, sounds good. Let's just move forward with this implementation.'
D. 'I agree; let's prioritize simplicity and reduce cognitive load for developers.'
This scenario highlights the importance of respectfully questioning design decisions during code reviews. Option B is best because it politely asks for clarification on David's reasoning without directly dismissing his approach. It opens a dialogue to explore potential alternatives and ensure the most effective solution is being used. Options A, C, and D are less constructive – A focuses solely on optimization without understanding the context; C simply accepts the decision; and D offers a potentially premature judgment of simplicity.
9 / 24
You're reviewing a PR for a new API endpoint that retrieves product information. A developer has added extensive logging to the endpoint but used overly verbose log statements that include the entire request and response body in every call. Another developer comments: 'This level of logging seems excessive. It's going to significantly impact performance, especially with high traffic volumes. Can we reduce the amount of data logged?' Which of the following responses from the original developer is most appropriate?
This question tests understanding of constructive communication during code review. Option B acknowledges the concern but doesn't offer a solution, while A defends an unnecessarily verbose approach. Option D introduces irrelevant arguments about security/compliance. Option C is the best response because it invites a collaborative discussion to find a balance between thorough logging and performance, demonstrating a willingness to compromise and improve the design – a key skill for developers.
10 / 24
Sarah just submitted a pull request for a new user authentication service. During the review, David leaves this comment: 'I'm not entirely sure about this implementation of rate limiting. It seems a little aggressive, and I'm concerned it might block legitimate users during peak times. Could you elaborate on your reasoning?' Which response from Sarah best addresses David's concerns while maintaining a professional tone?
The best response acknowledges David's concerns and expresses willingness to investigate. Option 1 is dismissive and unprofessional. Option 3 is confrontational and shuts down discussion. Option 2 demonstrates a collaborative approach – showing you value the feedback and are willing to make adjustments based on it. Option 4, while technically correct, doesn't address the underlying concern about potential impact.
11 / 24
Maria submitted a PR to update the user profile API. During review, John commented: 'I'm seeing a potential race condition here – if two users simultaneously try to update their avatar URLs, we might end up with corrupted data. Can you explain how this is being prevented?' Which response from Maria best addresses John's concern while maintaining a collaborative tone?
// Potential race condition during avatar updates
updateAvatar(userId, imageUrl) { ... }
The correct answer demonstrates understanding of the issue and proposes a concrete solution. Options A and D dismiss the concern without acknowledging the potential problem, which is unprofessional. Option B introduces a solution without fully explaining the context or confirming its effectiveness. Option 3 indicates an active investigation and planning for mitigation, aligning with collaborative code review practices – the ideal response in this scenario.
12 / 24
Alex submitted a pull request to refactor the payment processing module. During review, Ben left this comment: 'I'm concerned about the error handling here. It seems to just swallow exceptions without logging anything. This makes debugging extremely difficult.' Which of the following responses from Alex is most appropriate and constructive?
A. 'Thanks for the feedback, Ben. I'll add some logging.'
B. 'I've already considered this, and it's perfectly fine as it is. We don't need to log every exception.'
C. 'Okay, let's discuss the specific exceptions you're concerned about and how we can best handle them while maintaining performance. Could you provide an example?'
D. 'I disagree with your assessment; this approach is standard practice in our codebase.'
The correct answer (C) demonstrates a willingness to collaborate and understand Ben's concerns. It moves beyond simply acknowledging the feedback and instead seeks clarification on *why* Ben found the error handling problematic – specifically asking for an example. Options A and B are dismissive and don't address the root of the issue, while option D is confrontational and unproductive. A good code review response focuses on understanding the reviewer's perspective and finding a mutually agreeable solution.
13 / 24
During a code review for a new feature that calculates shipping costs, Liam left this comment: 'This calculation seems overly complex. Could we simplify it by using a pre-calculated rate based on weight and destination?' David responded with: 'I've considered the various shipping providers and their different pricing models. This approach allows us to accurately reflect all potential costs.' Which of the following is the MOST appropriate follow-up comment from Liam?
A. 'That's great, but we should still optimize for performance.'
B. 'Could you explain the rationale behind using such a complex calculation? Perhaps there's a simpler alternative that would achieve the same result.'
C. 'Okay, sounds good. Let's just move forward with this implementation.'
D. 'I agree; let's prioritize simplicity and reduce cognitive load for developers.'
This scenario highlights the importance of respectfully questioning design decisions during code reviews. Option B is best because it politely asks for clarification on David's reasoning without directly dismissing his approach. It opens a dialogue to explore potential alternatives and ensure the most effective solution is being used. Options A, C, and D are less constructive – A focuses solely on optimization without understanding the context; C simply accepts the decision; and D offers a potentially premature judgment of simplicity.
14 / 24
You're reviewing a PR for a new API endpoint that retrieves product information. A developer has added extensive logging to the endpoint but used overly verbose log statements that include the entire request and response body in every call. Another developer comments: 'This level of logging seems excessive. It's going to significantly impact performance, especially with high traffic volumes. Can we reduce the amount of data logged?' Which of the following responses from the original developer is most appropriate?
This question tests understanding of constructive communication during code review. Option B acknowledges the concern but doesn't offer a solution, while A defends an unnecessarily verbose approach. Option D introduces irrelevant arguments about security/compliance. Option C is the best response because it invites a collaborative discussion to find a balance between thorough logging and performance, demonstrating a willingness to compromise and improve the design – a key skill for developers.
15 / 24
Sarah just submitted a pull request for a new user authentication service. During the review, David leaves this comment: 'I'm not entirely sure about this implementation of rate limiting. It seems a little aggressive, and I'm concerned it might block legitimate users during peak times. Could you elaborate on your reasoning?' Which response from Sarah best addresses David's concerns while maintaining a professional tone?
The best response acknowledges David's concerns and expresses willingness to investigate. Option 1 is dismissive and unprofessional. Option 3 is confrontational and shuts down discussion. Option 2 demonstrates a collaborative approach – showing you value the feedback and are willing to make adjustments based on it. Option 4, while technically correct, doesn't address the underlying concern about potential impact.
16 / 24
Maria submitted a PR to update the user profile API. During review, John commented: 'I'm seeing a potential race condition here – if two users simultaneously try to update their avatar URLs, we might end up with corrupted data. Can you explain how this is being prevented?' Which response from Maria best addresses John's concern while maintaining a collaborative tone?
// Potential race condition during avatar updates
updateAvatar(userId, imageUrl) { ... }
The correct answer demonstrates understanding of the issue and proposes a concrete solution. Options A and D dismiss the concern without acknowledging the potential problem, which is unprofessional. Option B introduces a solution without fully explaining the context or confirming its effectiveness. Option 3 indicates an active investigation and planning for mitigation, aligning with collaborative code review practices – the ideal response in this scenario.
17 / 24
Alex submitted a pull request to refactor the payment processing module. During review, Ben left this comment: 'I'm concerned about the error handling here. It seems to just swallow exceptions without logging anything. This makes debugging extremely difficult.' Which of the following responses from Alex is most appropriate and constructive?
A. 'Thanks for the feedback, Ben. I'll add some logging.'
B. 'I've already considered this, and it's perfectly fine as it is. We don't need to log every exception.'
C. 'Okay, let's discuss the specific exceptions you're concerned about and how we can best handle them while maintaining performance. Could you provide an example?'
D. 'I disagree with your assessment; this approach is standard practice in our codebase.'
The correct answer (C) demonstrates a willingness to collaborate and understand Ben's concerns. It moves beyond simply acknowledging the feedback and instead seeks clarification on *why* Ben found the error handling problematic – specifically asking for an example. Options A and B are dismissive and don't address the root of the issue, while option D is confrontational and unproductive. A good code review response focuses on understanding the reviewer's perspective and finding a mutually agreeable solution.
18 / 24
During a code review for a new feature that calculates shipping costs, Liam left this comment: 'This calculation seems overly complex. Could we simplify it by using a pre-calculated rate based on weight and destination?' David responded with: 'I've considered the various shipping providers and their different pricing models. This approach allows us to accurately reflect all potential costs.' Which of the following is the MOST appropriate follow-up comment from Liam?
A. 'That's great, but we should still optimize for performance.'
B. 'Could you explain the rationale behind using such a complex calculation? Perhaps there's a simpler alternative that would achieve the same result.'
C. 'Okay, sounds good. Let's just move forward with this implementation.'
D. 'I agree; let's prioritize simplicity and reduce cognitive load for developers.'
This scenario highlights the importance of respectfully questioning design decisions during code reviews. Option B is best because it politely asks for clarification on David's reasoning without directly dismissing his approach. It opens a dialogue to explore potential alternatives and ensure the most effective solution is being used. Options A, C, and D are less constructive – A focuses solely on optimization without understanding the context; C simply accepts the decision; and D offers a potentially premature judgment of simplicity.
19 / 24
You're reviewing a PR for a new API endpoint that retrieves product information. A developer has added extensive logging to the endpoint but used overly verbose log statements that include the entire request and response body in every call. Another developer comments: 'This level of logging seems excessive. It's going to significantly impact performance, especially with high traffic volumes. Can we reduce the amount of data logged?' Which of the following responses from the original developer is most appropriate?
This question tests understanding of constructive communication during code review. Option B acknowledges the concern but doesn't offer a solution, while A defends an unnecessarily verbose approach. Option D introduces irrelevant arguments about security/compliance. Option C is the best response because it invites a collaborative discussion to find a balance between thorough logging and performance, demonstrating a willingness to compromise and improve the design – a key skill for developers.
20 / 24
Sarah just submitted a pull request for a new user authentication service. During the review, David leaves this comment: 'I'm not entirely sure about this implementation of rate limiting. It seems a little aggressive, and I'm concerned it might block legitimate users during peak times. Could you elaborate on your reasoning?' Which response from Sarah best addresses David's concerns while maintaining a professional tone?
The best response acknowledges David's concerns and expresses willingness to investigate. Option 1 is dismissive and unprofessional. Option 3 is confrontational and shuts down discussion. Option 2 demonstrates a collaborative approach – showing you value the feedback and are willing to make adjustments based on it. Option 4, while technically correct, doesn't address the underlying concern about potential impact.
21 / 24
Maria submitted a PR to update the user profile API. During review, John commented: 'I'm seeing a potential race condition here – if two users simultaneously try to update their avatar URLs, we might end up with corrupted data. Can you explain how this is being prevented?' Which response from Maria best addresses John's concern while maintaining a collaborative tone?
// Potential race condition during avatar updates
updateAvatar(userId, imageUrl) { ... }
The correct answer demonstrates understanding of the issue and proposes a concrete solution. Options A and D dismiss the concern without acknowledging the potential problem, which is unprofessional. Option B introduces a solution without fully explaining the context or confirming its effectiveness. Option 3 indicates an active investigation and planning for mitigation, aligning with collaborative code review practices – the ideal response in this scenario.
22 / 24
Alex submitted a pull request to refactor the payment processing module. During review, Ben left this comment: 'I'm concerned about the error handling here. It seems to just swallow exceptions without logging anything. This makes debugging extremely difficult.' Which of the following responses from Alex is most appropriate and constructive?
A. 'Thanks for the feedback, Ben. I'll add some logging.'
B. 'I've already considered this, and it's perfectly fine as it is. We don't need to log every exception.'
C. 'Okay, let's discuss the specific exceptions you're concerned about and how we can best handle them while maintaining performance. Could you provide an example?'
D. 'I disagree with your assessment; this approach is standard practice in our codebase.'
The correct answer (C) demonstrates a willingness to collaborate and understand Ben's concerns. It moves beyond simply acknowledging the feedback and instead seeks clarification on *why* Ben found the error handling problematic – specifically asking for an example. Options A and B are dismissive and don't address the root of the issue, while option D is confrontational and unproductive. A good code review response focuses on understanding the reviewer's perspective and finding a mutually agreeable solution.
23 / 24
During a code review for a new feature that calculates shipping costs, Liam left this comment: 'This calculation seems overly complex. Could we simplify it by using a pre-calculated rate based on weight and destination?' David responded with: 'I've considered the various shipping providers and their different pricing models. This approach allows us to accurately reflect all potential costs.' Which of the following is the MOST appropriate follow-up comment from Liam?
A. 'That's great, but we should still optimize for performance.'
B. 'Could you explain the rationale behind using such a complex calculation? Perhaps there's a simpler alternative that would achieve the same result.'
C. 'Okay, sounds good. Let's just move forward with this implementation.'
D. 'I agree; let's prioritize simplicity and reduce cognitive load for developers.'
This scenario highlights the importance of respectfully questioning design decisions during code reviews. Option B is best because it politely asks for clarification on David's reasoning without directly dismissing his approach. It opens a dialogue to explore potential alternatives and ensure the most effective solution is being used. Options A, C, and D are less constructive – A focuses solely on optimization without understanding the context; C simply accepts the decision; and D offers a potentially premature judgment of simplicity.
24 / 24
You're reviewing a PR for a new API endpoint that retrieves product information. A developer has added extensive logging to the endpoint but used overly verbose log statements that include the entire request and response body in every call. Another developer comments: 'This level of logging seems excessive. It's going to significantly impact performance, especially with high traffic volumes. Can we reduce the amount of data logged?' Which of the following responses from the original developer is most appropriate?
This question tests understanding of constructive communication during code review. Option B acknowledges the concern but doesn't offer a solution, while A defends an unnecessarily verbose approach. Option D introduces irrelevant arguments about security/compliance. Option C is the best response because it invites a collaborative discussion to find a balance between thorough logging and performance, demonstrating a willingness to compromise and improve the design – a key skill for developers.
What does the "Writing PR Comments" exercise practise?
Practice writing clear, constructive pull request comments. 4 exercises covering praise, suggestions, bug flags, and tone in professional code reviews.
How many questions are in this exercise?
This exercise has 24 questions, each multiple-choice with a full explanation shown after you answer.
What English level is this exercise for?
This exercise is tagged Intermediate. If the vocabulary feels difficult, browse the Code Review Language category page for an easier module to start with.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free with no account, sign-up, or paywall.
Do I get feedback if I answer incorrectly?
Yes — whichever option you choose, right or wrong, you'll immediately see an explanation clarifying the correct term and why the other options don't fit.
Can I retry this exercise?
Yes — once you finish all the questions, a "Try again" button on the results screen resets the exercise so you can practise as many times as you like.
Do I need an account to track my progress?
No account is required. Your progress bar and score for this session are tracked in the browser as you go, but nothing is saved once you leave the page.
Is "Writing PR Comments" part of a larger series?
Yes — it's one exercise in the Code Review Language category on CoderSlingo. See the category page for the full list of related exercises on similar terminology.
Can I link directly to this exercise?
Yes — this exercise has its own permanent URL, so you can bookmark it or share the link directly with a colleague or study partner.
Where can I find more exercises like this one?
See the Code Review Language category page for related exercises, or browse the main Exercises hub for other IT English topics.