0
0
HLDsystem_design~10 mins

Distributed caching (Redis, Memcached) in HLD - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the main purpose of distributed caching.

HLD
Distributed caching is used to [1] data to reduce latency and load on the main database.
Drag options to blanks, or click blank then click option'
Astore frequently accessed
Bdelete rarely used
Cencrypt sensitive
Dbackup all
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing backup or encryption instead of storing frequently accessed data.
2fill in blank
medium

Complete the code to select the correct caching strategy.

HLD
In distributed caching, the [1] strategy ensures that data is updated in the cache when the database changes.
Drag options to blanks, or click blank then click option'
Acache-aside
Bwrite-back
Clazy loading
Dwrite-through
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing write-back or cache-aside with write-through.
3fill in blank
hard

Fix the error in the cache invalidation approach.

HLD
To avoid stale data, the cache should be invalidated using [1] after the database update.
Drag options to blanks, or click blank then click option'
Atime-to-live (TTL)
Bwrite-back
Cmanual refresh
Dlazy expiration
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing manual refresh which requires manual intervention.
4fill in blank
hard

Fill both blanks to complete the cache key design and eviction policy.

HLD
Cache keys should be [1] to avoid collisions, and the eviction policy [2] removes least recently used items first.
Drag options to blanks, or click blank then click option'
Aunique
Brandom
CLRU
DFIFO
Attempts:
3 left
💡 Hint
Common Mistakes
Using random keys or FIFO eviction which may not be optimal.
5fill in blank
hard

Fill all three blanks to complete the distributed cache cluster setup.

HLD
The cache cluster uses [1] to distribute data, [2] to replicate data for fault tolerance, and [3] to monitor cluster health.
Drag options to blanks, or click blank then click option'
Aconsistent hashing
Bsharding
Creplication
Dheartbeat
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing sharding with consistent hashing or missing monitoring concepts.