All quizzesHard
Architectural Patterns — Series 3
Preview — 3 of 10 questions
What distinguishes MVVM from MVP in practice?
AMVVM forbids any logic in the view model; MVP allows it.
BMVVM is only for desktop applications; MVP is the web equivalent.
CThe ViewModel exposes observable state and commands and knows nothing about the View; the binding layer synchronises the two automatically, whereas an MVP Presenter holds a reference to its View and pushes updates into it explicitly.
DMVVM has no model layer, since the ViewModel replaces it.
What breaks if a reducer mutates its state argument or performs I/O?
AReference-equality checks stop detecting changes, so memoised selectors and React.memo skip re-renders; and replay, time-travel debugging and deterministic tests all become impossible.
BNothing — the store copies the state before calling the reducer.
COnly the developer tools are affected; the application behaves correctly.
DThe action would be dispatched twice.
A UserRepository returns Prisma model objects and exposes findMany(prismaWhereClause). What is wrong?
ANothing — passing the query through keeps the repository thin.
BIt should extend the ORM's base class instead.
CRepositories are only for SQL; a document database needs a DAO.
DThe ORM has leaked through the abstraction: callers now build ORM-specific queries and depend on ORM types, so the persistence choice is no longer swappable and the domain is no longer testable without it.
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.