0
0
Redisquery~20 mins

Real-time notification pattern in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Real-time Notification Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2: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
A["news", "sports"]
B["news"]
C[]
D["news", "sports", "weather"]
Attempts:
2 left
💡 Hint
PUBSUB CHANNELS lists all active channels with subscribers.
🧠 Conceptual
intermediate
2: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?
ASorted Set
BSet
CList
DHash
Attempts:
2 left
💡 Hint
Think about storing multiple key-value pairs per user.
📝 Syntax
advanced
2: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'.
APUBLISH updates Hello
BPUBLISH 'updates' 'Hello'
CPUBLISH updates 'Hello'
DPUBLISH 'updates' Hello
Attempts:
2 left
💡 Hint
Redis commands do not require quotes for simple strings.
optimization
advanced
2: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?
AUse a single Redis instance with many channels
BUse multiple Redis instances with sharded channels
CUse Redis transactions for publishing messages
DUse Redis sorted sets to queue messages
Attempts:
2 left
💡 Hint
Distributing load helps handle more messages.
🔧 Debug
expert
3: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"
AClient 2 used wrong channel name in PUBLISH
BRedis server is down
CClient 1 subscribed after Client 2 published the message
DClient 1 did not run SUBSCRIBE command correctly
Attempts:
2 left
💡 Hint
Messages published before subscription are not received.