Challenge - 5 Problems
Redis In-Memory Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why is Redis considered fast for in-memory data storage?
Redis is known for its speed. What is the main reason Redis can access data so quickly compared to traditional databases?
Attempts:
2 left
💡 Hint
Think about where Redis keeps its data during operation.
✗ Incorrect
Redis keeps all data in RAM, so it can read and write data very fast without waiting for disk access.
🧠 Conceptual
intermediate2:00remaining
What data structures does Redis support for in-memory storage?
Redis supports several data structures to store data in memory. Which of the following is NOT a native Redis data structure?
Attempts:
2 left
💡 Hint
Redis supports common simple data types but not complex graph structures natively.
✗ Incorrect
Redis supports strings, lists, sets, sorted sets, hashes, streams, but does not natively support graph data structures.
❓ query_result
advanced2:00remaining
What is the output of this Redis command sequence?
Given these Redis commands run in order, what is the output of the final command?
1. SET user:1 "Alice"
2. INCR user:1
3. GET user:1
Redis
SET user:1 "Alice" INCR user:1 GET user:1
Attempts:
2 left
💡 Hint
INCR only works on keys holding integer values.
✗ Incorrect
The INCR command tries to increment the value, but since "Alice" is not an integer, Redis returns an error.
❓ optimization
advanced2:00remaining
How to optimize Redis memory usage for large datasets?
You have a large dataset stored in Redis as many string keys. Which approach will best reduce memory usage?
Attempts:
2 left
💡 Hint
Grouping related data reduces overhead per key.
✗ Incorrect
Using hashes groups multiple fields under one key, reducing memory overhead compared to many separate keys.
🔧 Debug
expert3:00remaining
Why does this Redis Lua script fail to update the key?
Consider this Lua script run inside Redis:
local val = redis.call('GET', KEYS[1])
val = val + 1
redis.call('SET', KEYS[1], val)
If the key holds the string "10", why does this script cause an error?
Attempts:
2 left
💡 Hint
Think about Lua's type system and how it handles strings and numbers.
✗ Incorrect
The GET command returns a string. Lua cannot directly add a number to a string without converting the string to a number first.