0
0
Redisquery~20 mins

Client-side cluster support in Redis - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Redis Cluster Mastery
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 cluster command?
Consider a Redis cluster with 3 nodes. You run the command CLUSTER NODES. What kind of information does this command return?
Redis
CLUSTER NODES
AThe cluster configuration file contents.
BOnly the master nodes' IP addresses and ports.
CA list of all nodes in the cluster with their IDs, IP addresses, ports, roles, and slot ranges.
DThe current key-value pairs stored in the cluster.
Attempts:
2 left
💡 Hint
Think about what information is needed to understand the cluster topology.
🧠 Conceptual
intermediate
2:00remaining
How does client-side cluster support handle key distribution?
In Redis client-side cluster support, how does the client decide which node to send a command to for a given key?
AThe client calculates the hash slot of the key and sends the command to the node responsible for that slot.
BThe client sends the command to a random node and lets the cluster redirect it.
CThe client always sends commands to the master node only.
DThe client broadcasts the command to all nodes and waits for the first response.
Attempts:
2 left
💡 Hint
Think about how the cluster divides keys among nodes.
📝 Syntax
advanced
2:00remaining
Which Redis command syntax correctly requests a slot migration in a cluster?
You want to migrate slot 1000 from one node to another in a Redis cluster. Which command syntax is correct?
ACLUSTER SETSLOT 1000 MIGRATING <node-id>
BCLUSTER MIGRATE SLOT 1000 TO <node-id>
CCLUSTER SETSLOT MIGRATING 1000 <node-id>
DCLUSTER SLOT MIGRATE 1000 <node-id>
Attempts:
2 left
💡 Hint
Check the official Redis cluster command format for SETSLOT.
optimization
advanced
2:00remaining
How can client-side cluster support reduce redirections during key access?
Which approach best reduces the number of redirections a Redis client experiences when accessing keys in a cluster?
AThe client always queries a random node to get the latest cluster slots mapping before each command.
BThe client caches the cluster slots mapping and updates it only when a MOVED or ASK error occurs.
CThe client sends all commands to the cluster's master node to avoid redirections.
DThe client disables cluster mode and treats the cluster as a single node.
Attempts:
2 left
💡 Hint
Think about how clients can remember cluster topology to avoid unnecessary redirects.
🔧 Debug
expert
2:00remaining
Why does this Redis cluster client command cause a MOVED error?
A client sends the command GET user:123 to a Redis cluster node but receives a MOVED error pointing to another node. What is the most likely cause?
Redis
GET user:123
AThe client sent the command with an invalid syntax.
BThe key user:123 does not exist in the cluster.
CThe cluster is down and cannot process commands.
DThe client has an outdated slots cache and sent the command to the wrong node.
Attempts:
2 left
💡 Hint
Consider what MOVED errors indicate in Redis cluster communication.