tezvyn:

Explain ViewModel, Repository, and Data Source in MVVM

Source: developer.android.combeginner

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

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.

Explain ViewModel, Repository, and Data Source in MVVM · Tezvyn