Explain ViewModel, Repository, and Data Source in MVVM

This tests your grasp of separation of concerns in Android. A good answer defines ViewModel, Repository, and Data Source roles, then traces the unidirectional data flow. A red flag is having the ViewModel directly access a data source like Retrofit.
This question tests your understanding of separation of concerns and unidirectional data flow in Android's recommended architecture. A strong answer defines each component's role: ViewModel for UI state, Repository as the single source of truth, and Data Sources for I/O. Then, trace data from UI event to ViewModel to Repository and back. A common red flag is describing components that bypass the hierarchy, like a ViewModel calling Retrofit directly.
Read the original → developer.android.com
- #android
- #mvvm
- #architecture
- #jetpack
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.