CS FundamentalsVery hardProduct-company design interview
In MVVM, unlike MVC and MVP, how does the view usually get updated when data changes?
- A. Through data binding: the view binds declaratively to observable properties of the ViewModel, which does not reference the view
- B. The controller calls view.render() after every change
- C. The presenter holds a reference to a view interface and calls its setters
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A company organised as separate frontend, backend and database teams keeps producing a three-tier system even when microservices were…
- A public JSON API is used by many clients that ignore unknown fields. How many of these changes are breaking: (1) adding a new optional…
- In npm's semantic-version ranges, which versions does ^1.4.2 allow, and which does ^0.4.2 allow?
- Two developers run npm install on the same commit a month apart and get different dependency versions, though package.json is unchanged…
- Your app depends on libraries P and Q. P needs utils >=2.0 <3.0 and Q needs utils >=1.2 <2.0. In an ecosystem that allows only one version…
- How many of these refactoring statements are correct? 1. A refactoring must not change the observable behaviour of the code. 2. A good…