How would you avoid leaking personalized data through a server 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
Cache reuse must align with data ownership and freshness. Rendering a page on the server does not automatically make every cache entry safe to share.
A dashboard response includes customer-specific prices and is mistakenly cached only by URL.
A practical way to learn it
Trace two accounts requesting the same URL and mark every cache that must distinguish them.
Open Next.js 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 classify data as public, tenant-specific or user-specific and inspect every caching layer, including framework data caches, response caches and CDNs. Personalization and authorization must be reflected in a safe key or the response must bypass shared caching. I would test two users and changing permissions, not only one successful request. I would also check current framework defaults and invalidation behavior for the exact version and deployment. Sensitive values should not be exposed through static output, logs or an accidentally public endpoint.
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
- Assuming SSR disables shared caching automatically.
Now go one level deeper
- How would sign-out affect cached client data?
- What would an integration test for a cache leak look like?
Further reading
Further-reading links support learning; the reference is Sukoaa-authored, not an official employer answer key.