Challenge - 5 Problems
Redis Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Primary use of Redis as a cache
What is the main reason Redis is used as a cache in applications?
Attempts:
2 left
💡 Hint
Think about why caching helps speed up applications.
✗ Incorrect
Redis as a cache stores data temporarily to speed up access to frequently used information, reducing the need to fetch from slower databases.
🧠 Conceptual
intermediate2:00remaining
Redis as a message broker role
Which Redis feature allows it to act as a message broker?
Attempts:
2 left
💡 Hint
Message brokers help parts of an app talk to each other.
✗ Incorrect
Redis uses its Pub/Sub feature to send messages between clients, enabling it to work as a message broker.
❓ query_result
advanced2:00remaining
Result of Redis command for cache expiration
What is the output of the following Redis commands?
SET user:1 "Alice" EX 10
TTL user:1
SET user:1 "Alice" EX 10
TTL user:1
Redis
SET user:1 "Alice" EX 10 TTL user:1
Attempts:
2 left
💡 Hint
EX sets expiration in seconds; TTL returns remaining time.
✗ Incorrect
The SET command with EX 10 sets the key to expire in 10 seconds. TTL returns the remaining time to live, which is 10 seconds immediately after setting.
📝 Syntax
advanced2:00remaining
Correct Redis command to publish a message
Which Redis command correctly publishes the message "Hello" to the channel "news"?
Attempts:
2 left
💡 Hint
Redis commands do not require quotes for simple strings.
✗ Incorrect
The PUBLISH command syntax is: PUBLISH channel message. Quotes are not needed unless the client requires them, but Redis CLI accepts unquoted simple strings.
🧠 Conceptual
expert3:00remaining
Choosing Redis as data store vs cache
Which scenario best justifies using Redis as a primary data store instead of just a cache?
Attempts:
2 left
💡 Hint
Think about when data loss is unacceptable and fast access is critical.
✗ Incorrect
Using Redis as a primary data store fits scenarios needing fast, reliable access to data that cannot be lost, like real-time leaderboards.