0
0
Redisquery~20 mins

Pub/sub limitations (no persistence) in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Pub/Sub Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
What happens to messages sent before a subscriber connects?

In Redis Pub/Sub, if a message is published to a channel before a client subscribes, what happens to that message?

AThe subscriber receives the message once it connects.
BThe message is lost and the subscriber does not receive it.
CThe message is stored and delivered when the subscriber connects.
DThe message is queued and delivered in order after subscription.
Attempts:
2 left
💡 Hint

Think about whether Redis Pub/Sub stores messages for future subscribers.

🧠 Conceptual
intermediate
2:00remaining
Why does Redis Pub/Sub not guarantee message delivery?

Which reason best explains why Redis Pub/Sub does not guarantee message delivery to subscribers?

ABecause Redis stores messages only for a limited time.
BBecause subscribers must acknowledge each message to receive the next.
CBecause messages are sent only to currently connected subscribers without persistence.
DBecause Redis queues messages for offline subscribers but drops them if full.
Attempts:
2 left
💡 Hint

Consider how Redis handles message storage and subscriber connection status.

📝 Syntax
advanced
2:00remaining
Identify the incorrect Redis Pub/Sub command usage

Which of the following Redis commands is NOT valid for subscribing to a channel?

ASUBSCRIBER news
BPUBLISH news "Hello"
CSUBSCRIBE news sports
DSUBSCRIBE news
Attempts:
2 left
💡 Hint

Check the exact spelling of Redis Pub/Sub commands.

🔧 Debug
advanced
2:00remaining
Why does a subscriber miss messages after reconnecting?

A subscriber disconnects and then reconnects to a Redis Pub/Sub channel. It notices it missed messages sent during the disconnection. Why?

ARedis Pub/Sub queues messages but the queue was full.
BThe subscriber was subscribed to the wrong channel after reconnecting.
CThe subscriber did not send an ACK to receive missed messages.
DRedis Pub/Sub does not store messages for disconnected clients.
Attempts:
2 left
💡 Hint

Think about Redis Pub/Sub message persistence and client connection status.

optimization
expert
3:00remaining
How to ensure message persistence with Redis Pub/Sub limitations?

Given Redis Pub/Sub does not persist messages, which approach best ensures message persistence and delivery to clients that may disconnect?

AUse Redis Streams instead of Pub/Sub for message persistence.
BIncrease Redis memory to store more Pub/Sub messages.
CUse multiple Pub/Sub channels to duplicate messages.
DSubscribe clients with a delay to catch missed messages.
Attempts:
2 left
💡 Hint

Consider Redis features designed for message persistence and replay.