Explain ViewModel, Repository, and Data Source in MVVM

This tests your understanding of separation of concerns. A great answer defines ViewModel (UI state), Repository (data abstraction), and Data Sources (implementation), then explains the unidirectional data flow.
This question tests your understanding of separation of concerns and unidirectional data flow in MVVM. A strong answer first defines each component's role: ViewModel holds UI state, Repository is the single source of truth abstracting data origins, and Data Sources are the concrete implementations. Then, explain how the UI observes the ViewModel, which calls the Repository, which orchestrates the Data Sources. A major red flag is describing the ViewModel accessing Retrofit or Room directly, bypassing the Repository.
Read the original → developer.android.com
- #android
- #mvvm
- #architecture
- #kotlin
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.