Challenge - 5 Problems
Redis Real-time Notification Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
What is the output of this Redis PUBSUB CHANNELS command?
Assume two clients subscribe to channels 'news' and 'sports'. What does the command
PUBSUB CHANNELS return?Redis
PUBSUB CHANNELS
Attempts:
2 left
💡 Hint
PUBSUB CHANNELS lists all active channels with subscribers.
✗ Incorrect
The PUBSUB CHANNELS command returns all channels that have at least one subscriber. Since clients subscribed to 'news' and 'sports', these two channels appear.
🧠 Conceptual
intermediate2:00remaining
Which Redis data structure is best for storing user notification preferences in a real-time system?
You want to store which types of notifications each user wants to receive. Which Redis data structure fits best?
Attempts:
2 left
💡 Hint
Think about storing multiple key-value pairs per user.
✗ Incorrect
A Hash allows storing multiple fields and values per user, such as notification types and preferences, making it efficient for this use case.
📝 Syntax
advanced2:00remaining
Which Redis command syntax correctly publishes a message to a channel?
Select the correct syntax to publish the message 'Hello' to the channel 'updates'.
Attempts:
2 left
💡 Hint
Redis commands do not require quotes for simple strings.
✗ Incorrect
The correct syntax is
PUBLISH updates Hello. Redis commands take arguments without quotes unless the argument contains spaces or special characters.❓ optimization
advanced2:00remaining
How to optimize Redis Pub/Sub for high message throughput?
You have many subscribers and high message volume. Which approach improves Redis Pub/Sub performance?
Attempts:
2 left
💡 Hint
Distributing load helps handle more messages.
✗ Incorrect
Sharding channels across multiple Redis instances spreads the load and improves throughput by parallelizing message delivery.
🔧 Debug
expert3:00remaining
Why does this Redis Pub/Sub subscriber not receive messages?
A client runs
SUBSCRIBE news but never receives messages published to 'news'. What is the likely cause?Redis
Client 1: SUBSCRIBE news Client 2: PUBLISH news "Hello"
Attempts:
2 left
💡 Hint
Messages published before subscription are not received.
✗ Incorrect
Redis Pub/Sub delivers messages only to clients subscribed at the time of publishing. If Client 1 subscribed after Client 2 published, it misses the message.