How would you choose local state, Context or a query cache?
Understand the idea, explain it in your own words and use the rubric to find your next learning gap.
The idea behind the question
Different state has different ownership and lifetimes. Server data, local interaction state and durable drafts should not automatically share one global store.
A filter popup is local UI state; shared user settings and cached API results have different invalidation rules.
A practical way to learn it
Categorize the state in a ticket-search page and choose an owner and reset rule for each field.
Open React project studioThe related tool opens separately; your interview answer stays here. Written practice is self-guided, without automatic code grading.
Build an explanation you understand
- State what the concept does in plain language.
- Apply it to the example and make your assumptions explicit.
- Explain a trade-off, failure case and how you would test it.
- Distinguish your actual experience from a proposed approach.
How would you explain it?
Single-question timers reset on refresh. Full mock sessions can resume from this browser.
Strengthen your explanation
Compare reasoning, not identical wording. Reference answers describe a possible approach; replace hypothetical statements with truthful details from your own work.
One way to answer
I would identify who reads and writes each value and how long it must live. I would keep transient interaction state near the component, lift state to the nearest shared owner and use Context for suitable cross-tree dependencies. Server data benefits from a query cache with keys, freshness and invalidation semantics. A reducer or external store can help complex client transitions, but I would not choose it simply because the app is large. I would avoid storing the same derived or server value in several independent places.
What a strong explanation should cover
Tick only the points your own answer addresses. This is self-assessment, not AI scoring.
0 / 3 points self-reportedWatch out for
- Treating Context as an automatic replacement for server caching.
Now go one level deeper
- How would you reset state after signing out?
- What belongs in a URL rather than a store?
Further reading
Further-reading links support learning; the reference is Sukoaa-authored, not an official employer answer key.