Android MVVM Architecture
MVVM Architecture with Jetpack: ViewModel, LiveData, Data Binding, Separation of Concerns, Unidirectional Data Flow
18 면접 질문·
Mid-Level
1What is a ViewModel in Android?
1
What is a ViewModel in Android?
답변
A ViewModel is a Jetpack component that stores and manages UI-related data in a lifecycle-aware way. It survives configuration changes (screen rotation) and allows separating business logic from UI.
2How do you create a ViewModel instance in an Activity?
2
How do you create a ViewModel instance in an Activity?
답변
Use ViewModelProvider to create or retrieve a ViewModel instance. ViewModelProvider(this).get(MyViewModel.class) ensures you get the same instance even after screen rotation.
3Why should you never pass an Activity or View Context into a ViewModel?
3
Why should you never pass an Activity or View Context into a ViewModel?
답변
The ViewModel survives configuration changes and lives longer than Activities. Keeping an Activity Context reference would cause a memory leak. Use AndroidViewModel with Application Context if needed.
4
What is LiveData?
5
What is the difference between LiveData and MutableLiveData?
+15 면접 질문
기타 Android 면접 주제
Android Fundamentals
Junior
24개 질문Android UI and Resources
Junior
30개 질문Android Lifecycle
Junior
30개 질문Android Navigation
Junior
26개 질문Android Data Management
Junior
29개 질문Android Networking
Junior
29개 질문Android Testing
Junior
28개 질문Android Gradle
Junior
26개 질문Kotlin Language Essentials for Android
Junior
24개 질문Room Database
Mid-Level
25개 질문Background Work
Mid-Level
18개 질문Jetpack Compose
Mid-Level
28개 질문Permissions and Device Features
Mid-Level
21개 질문Firebase for Android
Mid-Level
23개 질문Advanced Android Networking
Mid-Level
13개 질문Kotlin Collections and Operators
Mid-Level
20개 질문Kotlin Coroutines and Flow
Mid-Level
20개 질문Android Dependency Injection
Mid-Level
15개 질문Android MVI Architecture
Mid-Level
17개 질문Android Clean Architecture
Senior
21개 질문Android Compose Advanced
Senior
17개 질문Android Performance and Monitoring
Senior
13개 질문Android Security and Privacy
Senior
18개 질문Android CI/CD and Release
Senior
15개 질문Android UX and Form Factors
Senior
18개 질문Android Testing Advanced
Senior
18개 질문