Test your Dagger knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.
Question 1/5Score 0
What is the purpose of using an interface with an abstract `@Binds` method in a Dagger Module, as an alternative to a concrete `@Provides` method, when a dependency needs a specific implementation chosen for an interface?
Questions in this quiz
What is the purpose of using an interface with an abstract `@Binds` method in a Dagger Module, as an alternative to a concrete `@Provides` method, when a dependency needs a specific implementation chosen for an interface?
What is a reasonable justification for a smaller Android project or a solo developer choosing to skip Dagger (or any formal DI framework) entirely, relying instead on simpler, manual dependency construction?
What is a reasonable justification for AVOIDING the older "Service Locator" pattern (where a class explicitly asks a central registry for its dependencies at the point of use) in favor of Dagger-style dependency INJECTION (where dependencies are provided to a class from outside, typically via its constructor)?
What is Dagger (Dagger 2)?
What is a reasonable justification for Dagger's compile-time code generation approach being considered advantageous for performance-sensitive Android applications, compared to a reflection-based dependency injection framework?
What is a reasonable way understanding Dagger's generated code (viewing the actual `DaggerAppComponent.java` file Dagger produces) can help a developer debug a confusing dependency injection issue?
What is a reasonable comparison between Dagger and Hilt (a more recent dependency injection library built specifically on top of Dagger for Android), given that Hilt has become a commonly recommended choice for newer Android projects?
What is the purpose of the `@Inject` annotation on a class's constructor in Dagger?
What is a reasonable justification for the benefit of Dagger catching dependency-configuration errors at COMPILE time (a missing dependency, an ambiguous binding) rather than those same errors only surfacing at RUNTIME (e.g. an app crash when a dependency can't actually be resolved)?
What is a Dagger "Component", and what is its role?
What is a Dagger "Module", and how does it relate to a Component?
What is a reasonable justification for the specific TESTABILITY benefit that dependency injection (as implemented via Dagger) provides for unit testing a class that depends on other classes/services?