Skip to main content
Databases & Storage

Redis In-Memory Architecture & Caching Quiz (2026)

15 Questions15 MinsPass: 80%

Test your mastery of Redis: In-memory data structures, eviction policies (LRU/LFU), persistence (RDB vs AOF), Pub/Sub, and clustering.

Question 1 of 150% Completed
Single Choice

Why is `KEYS *` considered dangerous in production Redis?

Select an option above

Redis: Assessment Scope & Sample Focus Areas

15 questions • 80% pass target

This interactive technical assessment checks your practical understanding of Redis (Databases & Storage) across syntax behavior, edge cases, and architectural decisions.

Topic 1 of 15

Why is `KEYS *` considered dangerous in production Redis?

Topic 2 of 15

What is the difference between Redis RDB snapshots and AOF (Append Only File) persistence?

Topic 3 of 15

What data structure is optimal for implementing a real-time gaming leaderboard in Redis?

Topic 4 of 15

What does the `allkeys-lru` eviction policy do when Redis reaches its `maxmemory` limit?

Topic 5 of 15

What is the difference between `HSET` / `HGETALL` (Hash) and storing a JSON string with `SET`?

Topic 6 of 15

What is Cache Stampede (Thundering Herd) and how can Redis prevent it?

Frequently Asked Questions

Redis Assessment: Key Technical Questions & Answers

5 Questions Answered
1Why is Redis single-threaded for command execution yet capable of sub-millisecond latencies?
Redis executes all core commands in a single thread, completely avoiding thread context switching, race conditions, and locking overhead. It achieves hundreds of thousands of operations per second because all data is stored strictly in memory (RAM), and it uses non-blocking I/O multiplexing (via epoll/kqueue) to handle tens of thousands of concurrent client socket connections simultaneously.
2What is the difference between Redis RDB (Snapshotting) and AOF (Append-Only File) persistence?
RDB creates point-in-time binary snapshots of memory at configured intervals (`save 60 1000`) using `fork()` to create a child process with copy-on-write; it offers fast recovery and compact storage but risks data loss between snapshots. AOF logs every write command sequentially (`appendfsync everysec` or `always`), offering near-zero data loss at the expense of larger file sizes and slower restart load times. Best practice is hybrid RDB-AOF persistence.
3How do Redis Eviction Policies work when memory exceeds `maxmemory`?
When memory hits `maxmemory`, Redis applies configured eviction policies: `noeviction` (returns errors on new writes), `allkeys-lru` / `volatile-lru` (evicts least recently used keys across all or expiring keys), `allkeys-lfu` / `volatile-lfu` (evicts least frequently used keys), and `volatile-ttl` (evicts keys with the shortest remaining time-to-live). Redis uses an approximate sampling algorithm (evaluating 5-10 random keys) rather than true LRU to minimize CPU and RAM overhead.
4What are Redis Hashes vs Strings for object caching and memory efficiency?
Caching JSON objects as raw Strings requires serialization/deserialization and forces rewriting the entire string to update a single field. Redis Hashes (`HSET`, `HGET`) store objects as key-value field pairs. When a hash contains fewer fields than `hash-max-ziplist-entries` (default 512), Redis encodes the hash as an ultra-compact memory-efficient ziplist/listpack, saving up to 80% RAM compared to individual Strings.
5How does Redis Sentinel provide High Availability compared to Redis Cluster?
Redis Sentinel monitors standalone master-replica setups; if the master fails, Sentinel automatically elects a replica and promotes it to master, reconfiguring clients via pub/sub discovery. Redis Cluster is a distributed shared-nothing architecture that partitions data horizontally across 16,384 Hash Slots across multiple master nodes, providing both automatic failover and horizontal write/read scaling.

Next Steps for Mastery

Reinforce your knowledge with cheatsheets, interactive sandboxes, and interview prep.