CS FundamentalsVery hardProduct-company design interview

In MVVM, unlike MVC and MVP, how does the view usually get updated when data changes?

  1. A. Through data binding: the view binds declaratively to observable properties of the ViewModel, which does not reference the view
  2. B. The controller calls view.render() after every change
  3. C. The presenter holds a reference to a view interface and calls its setters
  4. D. The model writes directly to the view's widgets

Correct answer: A. Through data binding: the view binds declaratively to observable properties of the ViewModel, which does not reference the view

The ViewModel exposes state and commands; a binding framework keeps the view in sync, so the ViewModel can be unit-tested without any UI. In MVP the presenter actively pushes data through a view interface.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic