Practice vocabulary for suggesting refactors in code review: simplification, extraction, abstraction opportunities, and nit language.
0 / 22 completed
1 / 22
A reviewer writes: 'This could be simplified to a single map() call.' What kind of feedback is this?
'This could be simplified to...' is a constructive, non-blocking refactor suggestion. It proposes a cleaner equivalent without demanding the author change it — the author can consider it and decide whether to apply it.
2 / 22
A reviewer says: 'Consider extracting this into a function.' What problem are they identifying?
Extracting into a function addresses two problems: inline complexity (a long block of logic is hard to understand at a glance) and duplication (the same logic appears multiple times and should have a single source of truth).
3 / 22
A comment reads: 'This pattern appears 3 times — opportunity to abstract.' What does this mean?
'This pattern appears 3 times' invokes the Rule of Three: once is fine, twice is a coincidence, three times is a signal to abstract. The reviewer is pointing out a DRY (Don't Repeat Yourself) violation and suggesting centralisation.
4 / 22
What does 'nit' mean at the start of a code review comment?
'Nit:' (short for nitpick) signals that the comment is a minor style preference or small optional improvement — not a blocking concern. It tells the author: 'I noticed this, but it won't block my approval if you disagree.'
5 / 22
A reviewer writes: 'This is a nit, but I'd inline this variable — it's only used once.' How should the author interpret this?
A nit comment is an invitation to improve, not a demand. The author can apply it if they agree it improves readability, or add a brief reply explaining why they prefer the current form. Either outcome is acceptable for the review to proceed.
6 / 22
PR Description
"I'm noticing a lot of duplicated logic here. Could we refactor this to use a helper function? It'll make the code more maintainable and easier to test."
This comment demonstrates constructive feedback aimed at suggesting a refactor. The reviewer isn't just pointing out a problem; they're offering a concrete solution (a helper function) and explaining the benefits – maintainability and testability. This approach is typical of effective code reviews, focusing on improving the code while providing reasoning for the suggestion. It avoids overly critical or demanding language.
7 / 22
During a code review of a new user onboarding flow, Sarah comments: 'I'm seeing repeated validation logic for email addresses across multiple steps. Perhaps we could create a reusable `validateEmail` function to centralize this and reduce duplication?' What is the primary benefit Sarah highlights when suggesting this refactor?
A: Sarah is pointing out a potential performance bottleneck caused by redundant code execution. B: Sarah is suggesting a change that improves code readability and maintainability by promoting code reuse. C: Sarah is advocating for a complete rewrite of the onboarding flow to utilize a different validation library. D: Sarah is focusing solely on reducing the number of lines of code in the function.
Sarah's comment focuses on the concept of 'code duplication,' which is a common concern in code reviews. By suggesting a `validateEmail` function, she's highlighting that creating reusable components reduces redundancy, making the code easier to understand, modify, and test – these are key benefits of refactoring. Option D misinterprets her suggestion; she isn't simply aiming for fewer lines of code but rather improved design and maintainability.
8 / 22
During a code review of a new service worker implementation, Mark posts this in the comments: 'This section handles user authentication and authorization separately for each API call. It seems like we could create an abstraction layer to encapsulate this logic and avoid repetition.' Considering Mark's comment, what is the *most* significant advantage he's highlighting with this suggestion?
A: Mark is concerned about potential security vulnerabilities arising from duplicated code handling sensitive data.
B: Mark is suggesting a refactor that improves code readability and maintainability by promoting code reuse and reducing redundancy—a key principle of good software design.
C: Mark's comment indicates a need to optimize the service worker's performance by parallelizing authentication and authorization requests.
D: Mark is solely focused on simplifying the codebase for easier debugging, regardless of other considerations.
The correct answer (B) accurately captures Mark's intention. He isn't primarily worried about security or performance—though those *could* be secondary benefits. Instead, he's emphasizing a fundamental software engineering principle: avoiding duplication (DRY - Don't Repeat Yourself). This makes the code easier to understand, modify, and test in the long run. Options A and C represent specific concerns that might arise as consequences of poor design but aren't Mark's primary focus; option D is too narrow.
9 / 22
PR Description
"I'm noticing a lot of duplicated logic here. Could we refactor this to use a helper function? It'll make the code more maintainable and easier to test."
This comment demonstrates constructive feedback aimed at suggesting a refactor. The reviewer isn't just pointing out a problem; they're offering a concrete solution (a helper function) and explaining the benefits – maintainability and testability. This approach is typical of effective code reviews, focusing on improving the code while providing reasoning for the suggestion. It avoids overly critical or demanding language.
10 / 22
During a code review of a new user onboarding flow, Sarah comments: 'I'm seeing repeated validation logic for email addresses across multiple steps. Perhaps we could create a reusable `validateEmail` function to centralize this and reduce duplication?' What is the primary benefit Sarah highlights when suggesting this refactor?
A: Sarah is pointing out a potential performance bottleneck caused by redundant code execution. B: Sarah is suggesting a change that improves code readability and maintainability by promoting code reuse. C: Sarah is advocating for a complete rewrite of the onboarding flow to utilize a different validation library. D: Sarah is focusing solely on reducing the number of lines of code in the function.
Sarah's comment focuses on the concept of 'code duplication,' which is a common concern in code reviews. By suggesting a `validateEmail` function, she's highlighting that creating reusable components reduces redundancy, making the code easier to understand, modify, and test – these are key benefits of refactoring. Option D misinterprets her suggestion; she isn't simply aiming for fewer lines of code but rather improved design and maintainability.
11 / 22
During a code review of a new service worker implementation, Mark posts this in the comments: 'This section handles user authentication and authorization separately for each API call. It seems like we could create an abstraction layer to encapsulate this logic and avoid repetition.' Considering Mark's comment, what is the *most* significant advantage he's highlighting with this suggestion?
A: Mark is concerned about potential security vulnerabilities arising from duplicated code handling sensitive data.
B: Mark is suggesting a refactor that improves code readability and maintainability by promoting code reuse and reducing redundancy—a key principle of good software design.
C: Mark's comment indicates a need to optimize the service worker's performance by parallelizing authentication and authorization requests.
D: Mark is solely focused on simplifying the codebase for easier debugging, regardless of other considerations.
The correct answer (B) accurately captures Mark's intention. He isn't primarily worried about security or performance—though those *could* be secondary benefits. Instead, he's emphasizing a fundamental software engineering principle: avoiding duplication (DRY - Don't Repeat Yourself). This makes the code easier to understand, modify, and test in the long run. Options A and C represent specific concerns that might arise as consequences of poor design but aren't Mark's primary focus; option D is too narrow.
12 / 22
PR Description
"I'm noticing a lot of duplicated logic here. Could we refactor this to use a helper function? It'll make the code more maintainable and easier to test."
This comment demonstrates constructive feedback aimed at suggesting a refactor. The reviewer isn't just pointing out a problem; they're offering a concrete solution (a helper function) and explaining the benefits – maintainability and testability. This approach is typical of effective code reviews, focusing on improving the code while providing reasoning for the suggestion. It avoids overly critical or demanding language.
13 / 22
During a code review of a new user onboarding flow, Sarah comments: 'I'm seeing repeated validation logic for email addresses across multiple steps. Perhaps we could create a reusable `validateEmail` function to centralize this and reduce duplication?' What is the primary benefit Sarah highlights when suggesting this refactor?
A: Sarah is pointing out a potential performance bottleneck caused by redundant code execution. B: Sarah is suggesting a change that improves code readability and maintainability by promoting code reuse. C: Sarah is advocating for a complete rewrite of the onboarding flow to utilize a different validation library. D: Sarah is focusing solely on reducing the number of lines of code in the function.
Sarah's comment focuses on the concept of 'code duplication,' which is a common concern in code reviews. By suggesting a `validateEmail` function, she's highlighting that creating reusable components reduces redundancy, making the code easier to understand, modify, and test – these are key benefits of refactoring. Option D misinterprets her suggestion; she isn't simply aiming for fewer lines of code but rather improved design and maintainability.
14 / 22
During a code review of a new service worker implementation, Mark posts this in the comments: 'This section handles user authentication and authorization separately for each API call. It seems like we could create an abstraction layer to encapsulate this logic and avoid repetition.' Considering Mark's comment, what is the *most* significant advantage he's highlighting with this suggestion?
A: Mark is concerned about potential security vulnerabilities arising from duplicated code handling sensitive data.
B: Mark is suggesting a refactor that improves code readability and maintainability by promoting code reuse and reducing redundancy—a key principle of good software design.
C: Mark's comment indicates a need to optimize the service worker's performance by parallelizing authentication and authorization requests.
D: Mark is solely focused on simplifying the codebase for easier debugging, regardless of other considerations.
The correct answer (B) accurately captures Mark's intention. He isn't primarily worried about security or performance—though those *could* be secondary benefits. Instead, he's emphasizing a fundamental software engineering principle: avoiding duplication (DRY - Don't Repeat Yourself). This makes the code easier to understand, modify, and test in the long run. Options A and C represent specific concerns that might arise as consequences of poor design but aren't Mark's primary focus; option D is too narrow.
15 / 22
PR Description
"I'm noticing a lot of duplicated logic here. Could we refactor this to use a helper function? It'll make the code more maintainable and easier to test."
This comment demonstrates constructive feedback aimed at suggesting a refactor. The reviewer isn't just pointing out a problem; they're offering a concrete solution (a helper function) and explaining the benefits – maintainability and testability. This approach is typical of effective code reviews, focusing on improving the code while providing reasoning for the suggestion. It avoids overly critical or demanding language.
16 / 22
During a code review of a new user onboarding flow, Sarah comments: 'I'm seeing repeated validation logic for email addresses across multiple steps. Perhaps we could create a reusable `validateEmail` function to centralize this and reduce duplication?' What is the primary benefit Sarah highlights when suggesting this refactor?
A: Sarah is pointing out a potential performance bottleneck caused by redundant code execution. B: Sarah is suggesting a change that improves code readability and maintainability by promoting code reuse. C: Sarah is advocating for a complete rewrite of the onboarding flow to utilize a different validation library. D: Sarah is focusing solely on reducing the number of lines of code in the function.
Sarah's comment focuses on the concept of 'code duplication,' which is a common concern in code reviews. By suggesting a `validateEmail` function, she's highlighting that creating reusable components reduces redundancy, making the code easier to understand, modify, and test – these are key benefits of refactoring. Option D misinterprets her suggestion; she isn't simply aiming for fewer lines of code but rather improved design and maintainability.
17 / 22
During a code review of a new service worker implementation, Mark posts this in the comments: 'This section handles user authentication and authorization separately for each API call. It seems like we could create an abstraction layer to encapsulate this logic and avoid repetition.' Considering Mark's comment, what is the *most* significant advantage he's highlighting with this suggestion?
A: Mark is concerned about potential security vulnerabilities arising from duplicated code handling sensitive data.
B: Mark is suggesting a refactor that improves code readability and maintainability by promoting code reuse and reducing redundancy—a key principle of good software design.
C: Mark's comment indicates a need to optimize the service worker's performance by parallelizing authentication and authorization requests.
D: Mark is solely focused on simplifying the codebase for easier debugging, regardless of other considerations.
The correct answer (B) accurately captures Mark's intention. He isn't primarily worried about security or performance—though those *could* be secondary benefits. Instead, he's emphasizing a fundamental software engineering principle: avoiding duplication (DRY - Don't Repeat Yourself). This makes the code easier to understand, modify, and test in the long run. Options A and C represent specific concerns that might arise as consequences of poor design but aren't Mark's primary focus; option D is too narrow.
18 / 22
During a code review of a new API endpoint, Alice comments: 'This function has too many responsibilities. It should be broken down into smaller, more manageable units.' What does Alice likely mean in this context?
Alice refers to the Single Responsibility Principle (SRP), which states that each class or module should have only one reason to change. This principle promotes modularity and reduces complexity – key goals of refactoring. Options A & B relate to design patterns and dependency injection which are not directly related to SRP.
19 / 22
Bob writes in the code review comments: 'This variable is only used here. Let's extract it into a separate function.' What technique does Bob suggest?
Bob is suggesting 'Extract Method', a common refactoring technique that involves creating a new function from a block of code within an existing function. This improves readability and reduces code duplication – core tenets of refactoring. Dependency Injection and Law of Demeter are related but different concepts.
20 / 22
Sarah observes: 'This class has a lot of conditional logic based on external data. We could move this to a separate service layer.' What is the primary rationale behind Sarah's suggestion?
Sarah's suggestion addresses dependency concerns. Moving conditional logic into a service layer decouples the class from external data sources and makes it easier to test in isolation. This aligns with good software design practices – crucial for maintainability and refactoring. Performance improvements are secondary.
21 / 22
Mark identifies: 'This method directly accesses the database table. It should be abstracted behind a repository interface.' What is Mark advocating for?
Mark suggests creating a repository interface to abstract the database access. This is part of the Repository pattern which promotes loose coupling, testability, and separation of concerns. While ORMs can be used, Mark's suggestion focuses on the core concept of abstraction – the key element of refactoring.
22 / 22
During a Slack discussion about a code review, David says: 'I'm seeing duplicated validation logic for user input across several components. Let's create a reusable validation helper.' What is the most important benefit of this suggestion?
David's suggestion directly addresses code duplication – a primary reason for refactoring. Reducing redundancy simplifies maintenance and reduces the risk of errors. While improved performance *might* be a side effect, it's not the core benefit, nor does it automatically generate tests or enforce security standards.
What does the "Suggesting Refactors in Code Review Quiz" exercise practise?
Practice vocabulary for suggesting refactors in code review: simplification, extraction, abstraction opportunities, and nit language.
How many questions are in this exercise?
This exercise has 22 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 "Suggesting Refactors in Code Review Quiz" 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.