Test your MVVM knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.
Question 1/5Score 0
Why does keeping the ViewModel free of direct UI framework references (like a specific button class) matter for testability?
Questions in this quiz
Why does keeping the ViewModel free of direct UI framework references (like a specific button class) matter for testability?
How does MVVM's separation of concerns differ from a design where a View directly manipulates Model objects with no intermediary layer?
What is a "command" in the context of MVVM (as used in frameworks like WPF)?
Why might unidirectional data flow (data flowing Model → ViewModel → View, with user actions flowing back up through commands) be considered valuable in an MVVM implementation?
What is a practical benefit of a ViewModel exposing already-formatted, presentation-ready values (like a formatted date string) rather than raw Model data?
What does MVVM stand for?
Why is dependency injection commonly used alongside MVVM (injecting services/repositories into a ViewModel rather than the ViewModel creating them directly)?
What is the primary responsibility of the "Model" in MVVM?
What is the key mechanism that typically connects a View to its ViewModel in MVVM (in frameworks that support it natively)?
What potential downside can arise if a ViewModel accumulates too much unrelated logic and state over time (a "massive ViewModel")?
What is the role of the "ViewModel" in MVVM?
How does a ViewModel typically expose asynchronous operations (like a network request) to the View in MVVM?