Multiple ChoiceHard 45s
Duplication vs wrong abstraction
You see the same 6-line block in two unrelated modules. A colleague proposes extracting a shared helper. What guidance fits best?
Options
- 1Prefer a little duplication over coupling unrelated modules to a forced shared abstraction
- 2Always deduplicate immediately and extract the shared helper regardless of module cohesion
- 3Copy the same six-line block a third time into a local utility to avoid any shared coupling
- 4Move the duplicated block into a global utils package that every module in the system imports
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.