Describe Hilt's component hierarchy and scope injection rules

Tests whether you understand Hilt's generated component tree and scoping rules. A strong answer lists the hierarchy, explains parent-outlives-child semantics, and states that ActivityScoped-into-Singleton injection fails at compile time.
Tests whether you understand Hilt's generated component hierarchy and why scoping mirrors Android lifecycle boundaries. A great answer lists the tree from SingletonComponent through ActivityRetainedComponent and ActivityComponent down to FragmentComponent and ViewComponent, explains downward-only dependency flow, and notes that injecting an ActivityScoped object into a Singleton is blocked at compile time to prevent stale activity references. A critical red flag is calling it a runtime leak or claiming subcomponents bypass the hierarchy.
Read the original → developer.android.com
- #android
- #hilt
- #dependency-injection
- #dagger
- #memory-management
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.