Multiple ChoiceHard 45s
Acyclic dependencies: breaking a cycle
Two packages A and B depend on each other. Which refactoring best breaks the cyclic dependency while preserving behavior?
Options
- 1Merge both packages into one so the cycle is hidden inside a single module
- 2Add more classes to each package so the dependencies become more granular
- 3Extract the shared abstraction into a new package that both depend on
- 4Introduce a global singleton that both packages call to cross the boundary
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.