codejump

Caching Strategies

Preview — 3 of 10 questions

An app checks Redis, finds no product, reads PostgreSQL and populates Redis. Who owns the fallback logic in this pattern?

AThe CDN implements origin-driven push invalidation.
BThe application implements cache-aside loading.
CThe cache implements transparent read-through loading.
DThe database implements synchronous write-through loading.

A cache acknowledges writes before asynchronously flushing them to the database. Which additional failure must the design address?

AEvery cache hit requires waiting for a database commit.
BThe database must execute each read twice to preserve ordering.
CRead replicas automatically reject all cached values.
DAcknowledged writes may disappear if unflushed state is lost.

A two-entry LRU cache starts empty. Requests are A, B, A, then C. Which entry is evicted when C is inserted?

AB, because A was accessed more recently.
BNeither, because hits increase the configured capacity.
CA, because it was inserted before B.
DC, because it has the fewest previous accesses.

Sign up free to play

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