Distributed Cache Invalidation u0026 Consistency Techniques Quiz Quiz

  1. Basic Definition

    Which of the following best defines cache invalidation in distributed systems?

    1. The process of marking cached data as stale when the original data changes
    2. The act of increasing cache size to avoid data loss
    3. Duplicating data across multiple servers for redundancy
    4. Compressing cached data to optimize storage
    5. The process of encrypting cache data for security
  2. Cache Consistency Technique

    What is a common technique to maintain cache consistency between nodes in a distributed system?

    1. Write-through caching
    2. Read-around caching
    3. Reverse proxying
    4. Load balencing
    5. Sharding with hashing
  3. Invalidation Scenario

    If a data item is updated on server A, which method ensures all other cache nodes are instantly aware of the change?

    1. Broadcast invalidation
    2. Time-to-live (TTL) expiry
    3. Manual refresh
    4. Cache warming
    5. Random eviction
  4. Time-to-Live

    What is the main disadvantage of using only Time-To-Live (TTL) for cache invalidation?

    1. Stale data can be served until TTL expires
    2. It synchronizes all caches instantly
    3. TTL reduces server load significantly
    4. TTL requires manual invalidation of all entries
    5. There is no way to set TTL in distributed caches
  5. Soft vs Hard Invalidation

    In a distributed caching system, what distinguishes soft invalidation from hard invalidation?

    1. Soft invalidation marks data as stale, hard invalidation removes it immediately
    2. Soft invalidation encrypts data, hard invalidation decrypts it
    3. Soft invalidation applies only to disk, hard to memory
    4. Soft invalidation always refreshes data eagerly
    5. Hard invalidation allows stale reads while soft does not
  6. Practical TTL Example

    Given a memcached setup with TTL set to 120 seconds, what happens if the underlying database value changes after 30 seconds?

    1. Cache continues serving the old value until TTL expires
    2. Memcached immediately fetches the new value
    3. Database write triggers an auto-invalidation
    4. Cache triggers a write-through update to the database
    5. All cache nodes instantly flush the value
  7. Invalidate-on-Write Technique

    Which cache consistency technique is being used if every write operation to the primary data also removes or updates the cache entry?

    1. Invalidate-on-write
    2. Write-around cache
    3. Read-ahead cache
    4. Push-based notification
    5. Eventual consitency
  8. Distributed Invalidations

    In which scenario would you most likely face challenges with cache invalidation due to network partitions?

    1. A distributed system with occasional network splits
    2. A single-node cache server
    3. A client-side browser cache
    4. A readonly distributed file system
    5. A monolithic application with no external dependencies
  9. Code Snippet Analysis

    What is the effect of this pseudocode in a cache system?nnif cache.has(key):n cache.invalidate(key)

    1. It removes the cached entry if it exists
    2. It updates the entry to a new value
    3. It writes the cached entry to disk
    4. It refreshes the cache from the backend store
    5. It locks the key to prevent concurrent access
  10. Read/Write Patterns

    Why is cache invalidation particularly challenging in distributed systems with high write throughput?

    1. Frequent updates make it hard to keep all cache nodes in sync
    2. High write throughput reduces the need for cache
    3. Write traffic always bypasses the cache layer
    4. Cache nodes automatically merge changes without invalidation
    5. Cache only affects read operations and not write ones