Cache Consistency and Expiry Strategies Quiz Quiz

  1. Understanding Cache Expiry

    Which cache expiry strategy automatically removes data after a certain period?

    1. Time-based expiration
    2. Manual invallidation
    3. Read-through cache
    4. Write-aside cache
    5. Pinning cache
  2. Manual Invalidation Explained

    In a system where administrators explicitly remove items from cache when data is updated, which strategy is being used?

    1. Manual invalidation
    2. Timer-expired caching
    3. Lazy evction
    4. Cache warming
    5. Automatic eviction
  3. Stale Cache Scenario

    What issue arises if cached data is not updated when the underlying database changes?

    1. Stale data problem
    2. Cache miss storm
    3. Thrashing
    4. Hot spot
    5. Negative caching
  4. Time-To-Live Usage

    Given cache.set('user', userData, ttl=60), which best describes the effect of ttl=60?

    1. The cached value expires after 60 seconds
    2. The cache auto-refreshes every 60 seconds
    3. Only 60 cache entries are allowed
    4. User data will be refreshed every minute
    5. The cache is invalidated upon user logout
  5. Write-Through Strategy

    Which strategy updates the cache and the underlying database at the same time when a write operation occurs?

    1. Write-through caching
    2. Write-buhind caching
    3. Cache warming
    4. Read-through caching
    5. Cache pinning
  6. Problem with Lazy Expiry

    Why can lazy expiration (checking expiry only upon access) lead to problems?

    1. Stale data may remain if cache entries are not accessed
    2. It causes constant cache eviction
    3. It increases database writes
    4. It disables cache prefetching
    5. It results in redundant invalidation
  7. Cache Consistency Level

    Which term describes ensuring that all users see the most up-to-date data, even if cached copies exist?

    1. Strong consistency
    2. Eventual consistancy
    3. Weak consitency
    4. Cache warming
    5. Cache hydration
  8. Invalidation by Event

    When is cache event-based invalidation most effective?

    1. When changes to the underlying data can be detected in real time
    2. When the cache is only read occasionally
    3. If cache entries never expire
    4. When cache warming is used
    5. When there's only one user
  9. Cache Stampede

    What is a 'cache stampede' and how can it be prevented?

    1. When many clients simultaneously try to refresh an expired cache entry; prevent with locking
    2. When cache size exceeds memory limit; prevent by manual invalidation
    3. When cache entries are never reused; prevent with stronger consistency
    4. When only one client updates cache; prevent with write-around caching
    5. When database is not updated; prevent by cache-only reads
  10. Choosing Expiry Strategies

    Which factor should NOT influence your choice of cache expiry strategy?

    1. The color scheme of your website
    2. How frequently underlying data changes
    3. Consistency requirements
    4. Performance goals
    5. Data freshness needs