Design Patterns · Senior · Question 18 of 75
What is a Composition Root?
- ✓Correct answer: A single place where the dependency graph is assembled
- 2The root React component that renders all pages
- 3The root directory of a monorepo
Explanation
Concrete implementations (API client, logger, storage) are created and wired at the entry point (main, a root layout with providers), and the rest of the code receives abstractions. This keeps dependencies visible and replaceable.