0
0
Redisquery~20 mins

Master-replica architecture in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Master-Replica Expert
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
What is the output of the command INFO replication on a Redis replica?
You run INFO replication on a Redis replica node. What key information will you see in the output?
Redis
INFO replication
Arole:replica, master_host:<ip>, master_link_status:up
Brole:master, connected_slaves:0
Crole:client, connected_clients:10
Drole:sentinel, monitored_masters:1
Attempts:
2 left
💡 Hint
Think about what role a replica plays and what info it reports about its master.
🧠 Conceptual
intermediate
1:30remaining
Why does a Redis replica not accept write commands by default?
In a master-replica setup, why are write commands disabled on replicas by default?
ATo prevent data inconsistency by ensuring writes happen only on the master
BBecause replicas have no memory to store data
CTo reduce network traffic between nodes
DBecause replicas only store metadata, not actual data
Attempts:
2 left
💡 Hint
Consider the role of master and replica in data consistency.
📝 Syntax
advanced
1:30remaining
Which Redis command correctly promotes a replica to master?
You want to promote a Redis replica to become a master. Which command will do this correctly?
APROMOTE MASTER
BSLAVEOF NO ONE
CREPLICAOF NO ONE
DMASTER PROMOTE
Attempts:
2 left
💡 Hint
The command changed name in recent Redis versions.
optimization
advanced
2:00remaining
How can you reduce replication lag in a Redis master-replica setup?
Which approach helps reduce replication lag between master and replica in Redis?
AUse synchronous replication mode
BIncrease the number of replicas to distribute load
CDisable AOF persistence on the master
DEnable diskless replication to send data directly over the network
Attempts:
2 left
💡 Hint
Think about how data is transferred from master to replica.
🔧 Debug
expert
2:30remaining
Why does a Redis replica show master_link_status:down after network recovery?
After a network outage, your Redis replica shows master_link_status:down even though the network is restored. What is the most likely cause?
AThe master has crashed and is not accepting connections
BThe replica's replication backlog is lost and needs a full resync
CThe replica is still configured as a master
DThe replica's IP address changed and is not updated
Attempts:
2 left
💡 Hint
Consider what happens to replication state after network failures.