codejump

Frontend Architecture (RADIO) — Series 2

Preview — 3 of 10 questions

A dropdown's open state is used only inside one component. What is a sound default placement?

ACopy it independently into every sibling component.
BPut it in the global store so all state has one location.
CPersist it in the backend before displaying the dropdown.
DKeep it local unless sharing is required.

A like button updates immediately, then sends a request. The user toggles twice before the first response arrives. What is needed for correct reconciliation?

AAssociate responses with mutations and reconcile against the latest intended state.
BAlways revert to the initial state when any earlier request fails.
CApply every response in arrival order regardless of which action it represents.
DDisable all error handling because the UI has already updated.

A dashboard displays cached data while refreshing in the background. The refresh fails. What is an appropriate policy for noncritical data?

AKeep usable cached data and communicate staleness/error according to the product policy.
BMark the cache permanently fresh because the refresh was attempted.
CReplace all data with an empty success state without explanation.
DRetry in a tight loop until the browser main thread becomes busy.

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.