0
0
Redisquery~20 mins

REPLICAOF command in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Replication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Purpose of the REPLICAOF command
What is the primary purpose of the REPLICAOF command in Redis?
ATo delete all keys in the current Redis database.
BTo configure a Redis instance to replicate data from a specified master server.
CTo create a backup snapshot of the current Redis database.
DTo rename an existing key in the Redis database.
Attempts:
2 left
💡 Hint
Think about how Redis handles data replication between servers.
query_result
intermediate
2:00remaining
Effect of REPLICAOF with no arguments
What is the result of running the command REPLICAOF NO ONE on a Redis replica?
AThe Redis instance starts replicating from a random master.
BThe Redis instance shuts down immediately.
CThe Redis instance deletes all its data.
DThe Redis instance stops replicating and becomes a master itself.
Attempts:
2 left
💡 Hint
Consider what happens when a replica stops following a master.
📝 Syntax
advanced
2:00remaining
Correct syntax for making a Redis instance a replica
Which of the following commands correctly makes a Redis instance replicate from a master at IP 192.168.1.100 on port 6379?
AREPLICAOF 192.168.1.100 6379
BREPLICAOF 6379 192.168.1.100
CREPLICAOF MASTER 192.168.1.100 6379
DREPLICAOF TO 192.168.1.100:6379
Attempts:
2 left
💡 Hint
The command expects IP and port in order.
optimization
advanced
2:00remaining
Optimizing failover with REPLICAOF
In a Redis setup with one master and multiple replicas, which approach using REPLICAOF helps minimize downtime during master failure?
ARun REPLICAOF with the old master's IP on all replicas repeatedly.
BRestart all replicas to automatically detect the new master.
CManually run REPLICAOF NO ONE on a replica to promote it, then update other replicas to replicate from the new master.
DDelete all replicas and create new ones after master failure.
Attempts:
2 left
💡 Hint
Think about how to quickly promote a replica and redirect others.
🔧 Debug
expert
2:00remaining
Identifying error in REPLICAOF usage
Given the command REPLICAOF 192.168.1.50 executed on a Redis instance, what error will Redis return?
AERR wrong number of arguments for 'REPLICAOF' command
BERR invalid IP address format
COK - replication started
DERR unknown command
Attempts:
2 left
💡 Hint
Check how many arguments REPLICAOF expects.