Caching interview questions
Practice 10 questions on caching. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
10 questions
- JavaScriptCoding exercise
Sliding TTL Cache
EASYImplement a cache whose entries expire a fixed time after their last access, not after being set.
15 minPractice - JavaScriptCoding exercise
Async Memoize with TTL
MEDIUMImplement an async memoize that caches results by key for a TTL and coalesces concurrent calls for the same key.
25 minPractice - JavaScriptCoding exercise
ETag Revalidation Cache
MEDIUMCache responses by URL and revalidate with an ETag, reusing cached data on a 304 Not Modified.
25 minPremium questionPractice - JavaScriptCoding exercise
Idempotency Key Queue
MEDIUMDedupe by idempotency key: run a task at most once per key, cache the result with a TTL, and retry on failure.
35 minPremium questionPractice - JavaScriptCoding exercise
Normalized Entity Cache
MEDIUMStore entities flat by id, normalizing nested relations and merging updates immutably.
25 minPremium questionPractice - JavaScriptCoding exercise
Singleflight
MEDIUMImplement singleflight so concurrent calls for the same key share one in-flight promise instead of duplicating work.
25 minPremium questionPractice - JavaScriptCoding exercise
Stale-While-Revalidate Cache
MEDIUMReturn cached data instantly, serving stale values while revalidating them in the background.
25 minPractice - JavaScriptCoding exercise
DataLoader
HARDBatch and cache load(key) calls made in one tick into a single batch function call, preserving order.
40 minPremium questionPractice - JavaScriptCoding exercise
Mini React Query Core
HARDBuild a framework-agnostic query cache with request dedup, staleTime, subscribers, and invalidation.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Realtime Search with Cache
HARDBuild a search box that caches results per query and dedupes in-flight requests.
40 minPremium questionPractice