Code Conservatory
Home
About
Overview
Getting Started
Blog
Contact
Menu
Home
About
Contact
Photo by
RODNAE Productions
from
Pexels
Quiz: Dry
1. When should the DRY principle be ignored?
When code is repetitive
When it leads to over-engineered solutions
To improve code readability
When code can be shortened
2. What can be a potential downside of strictly following the DRY principle?
Improved code maintainability
Reduced code size
Overly complex code
Better code organization
3. In which of the following scenarios is it better to allow some code duplication?
When it helps in code optimization
To ensure unrelated components remain decoupled
When there is a risk of code becoming unmaintainable
When duplication is minimal and does not affect the overall structure of the code
4. When should the DRY principle be re-evaluated?
When code becomes too short
When it creates unnecessary coupling
When shared components are too simple
When there are multiple ways to achieve the same goal
5. The DRY principle should not be applied:
To create a smaller codebase
When it results in tightly coupled components
When it increases code readability
To avoid code repetition
6. Which principle can sometimes be in conflict with the DRY principle?
SOLID
KISS (Keep It Simple, Stupid)
DRY (Don't Repeat Yourself)
YAGNI (You Aren't Gonna Need It)
7. In which of the following cases should the DRY principle be considered?
When there are multiple ways to achieve the same goal
When code is repetitive and can be abstracted into reusable components
When the code is already simple and easy to understand
When it is necessary to create complex solutions
8. Which of the following is a benefit of applying the DRY principle?
Decreased code maintainability
Increased code complexity
Reduced code duplication
More tightly coupled components
9. In which of the following cases should the DRY principle be ignored?
When there are multiple ways to achieve the same goal
When a single change affects multiple parts of the codebase
When the code is already simple and easy to understand
When it is necessary to create complex solutions
10. When is it appropriate to apply the DRY principle?
When code duplication is minimal and does not affect the overall structure of the code
To ensure unrelated components remain decoupled
When there is a risk of code becoming unmaintainable
When there are multiple ways to achieve the same goal
11. Which of the following is NOT a reason to apply the DRY principle?
To create a smaller codebase
To avoid code repetition
To improve code readability
When it results in tightly coupled components
12. When should code be duplicated to maintain simplicity?
When a component is used in multiple places
When a shared component would introduce unnecessary complexity
When it helps to improve code readability
When code duplication is minimal
Submit
You scored 0 out of 12.