Dagger Fundamentals & Manual DI
ARCHITECTURE › Dependency Injection
Dagger's compile-time graph, core annotations, and hand-rolled DI beneath Hilt.
Interviewers probe this to confirm you understand what Hilt actually generates rather than treating annotations as magic. Expect to explain the core Dagger building blocks (@Component, @Module, @Provides, @Inject, qualifiers, subcomponents), why compile-time graph validation beats reflection, how to wire dependencies manually with constructor injection and an AppContainer, and when a framework is the wrong choice. Strong answers connect the concepts to real tradeoffs like build-time errors versus runtime failures.
What this covers
- Core Dagger annotations: @Inject, @Component, @Module/@Provides, @Binds, @Subcomponent, and qualifiers
- How Dagger builds and validates the dependency graph at compile time and generates factories
- Scopes and subcomponents: reusing instances and creating releasable flow-scoped graphs
- Manual constructor injection and the AppContainer / flow-container pattern with no framework
- When NOT to reach for Hilt: KMP shared code, libraries, and tiny apps
- Hilt/Dagger (compile-time codegen) vs Koin (runtime service locator) tradeoffs
Study this topic
- Dagger Fundamentals & Manual DI explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Dagger Fundamentals & Manual DI interview questions and answers