Redis

Clustering Interview Questions

Clustering interview questions for Redis — fundamentals through advanced scenarios.

  • 20Questions with answers
  • 3Difficulty levels

Questions (20)

Browse beginner, intermediate, and advanced questions with answers — hide them when you want to self-test.

Question 1
Interview Beginner
Question

What is a hash slot, and why does a client see MOVED?

Answer:

Cluster hash slots are 16384; a key hashes to one slot and that slot lives on one master. MOVED redirects the client when the slot moved. Clients must be cluster-aware or they will keep hitting the wrong node.

Question 2
Interview Beginner
Question

Why put hash tags like {userId} in Redis keys?

Answer:

Hash tags {userId} in the key force several keys into the same slot so MULTI or Lua can touch them. Overusing one tag such as just {user} creates a hot slot. Tags are for related keys, not a global namespace.

Question 3
Interview Beginner
Question

What does a CROSSSLOT error mean, and what is the real fix?

Answer:

Cross-slot errors happen when a transaction or Lua script touches keys that hash to different slots. The fix is a hash tag, not a retry loop. MGET of random keys is also cross-slot unless they share a tag.

Question 4
Interview Beginner
Question

How is ASK different from MOVED during a reshard?

Answer:

ASK redirect is temporary during slot migration: the client should ASK the destination for that one command, then resume. Treating ASK like MOVED forever is wrong. Resharding is when you see ASK.

Question 5
Interview Beginner
Question

How does replica failover work in Cluster versus a standalone replica?

Answer:

Replica failover in Cluster elects a replica of a down master and moves those slots to it. Clients see MOVED. replica-priority and replica hang detection matter. Sentinel is a different HA story for standalone Redis.

Question 6
Interview Beginner
Question

When would you choose Redis Cluster instead of Sentinel?

Answer:

Cluster vs Sentinel: Sentinel watches a primary-replica set and failovers a single keyspace. Cluster shards 16384 slots across masters. Do not run Sentinel in front of Cluster nodes as if they were standalone.

Question 7
Interview Beginner
Question

How do you reshard slots without writing a custom migrator?

Answer:

Resharding moves hash slots between masters with redis-cli --cluster reshard or Cluster Manager. Keys in those slots stream to the new master. Watch ASK and MOVED rates and avoid heavy KEYS during the move.

Question 8
Interview Intermediate
Question

How do replica reads work in Cluster, and how stale can they be?

Answer:

READONLY lets a client read from a replica in Cluster; data can be stale by replication lag. READWRITE returns you to the master. Serving GET from replicas without READONLY fails.

Question 9
Interview Intermediate
Question

What does cluster-require-full-coverage do when masters disappear?

Answer:

cluster_state fail plus cluster-require-full-coverage means if too many masters are unreachable the cluster refuses writes. That is safer than serving a split brain. Setting coverage to no is a conscious availability trade.

Question 10
Interview Intermediate
Question

What steps actually add a new node to a live Cluster?

Answer:

Adding a node starts with CLUSTER MEET, then assign slots or CLUSTER REPLICATE to make it a replica. Empty masters with no slots still participate in gossip. Forgetting CLUSTER MEET is why a node stays isolated.

Question 11
Interview Intermediate
Question

Why can more hardware not fix a hot hash slot?

Answer:

Hot slots: one slot getting most writes, often a celebrity hash tag or low-cardinality key, cannot be split below one slot. The fix is a better key design, not more hardware. Empty neighboring slots are normal; hotness is about key distribution.

Question 12
Interview Intermediate
Question

Which extra port must be open for Cluster gossip, and what fails if it is not?

Answer:

Cluster bus port is the Redis port plus 10000 by default and must be open for gossip. Opening only 6379 and then wondering why failover never happens is a classic ops miss. TLS on the bus is a separate setting.

Question 13
Interview Intermediate
Question

Can MULTI/EXEC span two keys that live on different Cluster masters?

Answer:

MULTI/EXEC in Cluster is still single-slot. There is no distributed transaction across slots. If you need cross-entity atomicity, you tagged those keys together or you use an external workflow.

Question 14
Interview Intermediate
Question

What breaks in the application when you migrate from Sentinel to Cluster?

Answer:

Migrating from Sentinel to Cluster is a reshard of a previously unsharded dataset: dump and reload with hash tags planned. Applications must switch to cluster clients that handle MOVED. Dual-running both modes on one port does not work.

Question 15
Interview Advanced
Question

Why is a master without a replica a Cluster availability hole?

Answer:

Failure of a replica is cheap; failure of a master with no replica is slot downtime. Every master should have at least one replica. replica-validity-factor stops stale replicas from winning failover.

Question 16
Interview Advanced
Question

Is a burst of MOVED after reshard a healthy signal or an outage?

Answer:

CLUSTER SLOTS versus CLUSTER NODES: clients cache slot maps from SLOTS. Stale maps cause extra MOVED. After reshard, expect a burst of redirects; that is health, not an outage, unless they never converge.

Question 17
Interview Advanced
Question

How must Lua KEYS be designed so EVAL works on Cluster?

Answer:

Cross-slot Lua: even EVAL must list keys that map to one slot. Passing extra keys in ARGV to sneak around KEYS is unsupported and breaks under Cluster. Hash-tag the keys the script needs.

Question 18
Interview Advanced
Question

What should clients do if they land on a minority side of a Cluster partition?

Answer:

Network partition: Cluster uses a majority of masters to elect. A minority side stops taking writes if it cannot reach quorum. Clients on the minority must fail, not silently write. That is the CAP answer for Redis Cluster.

Question 19
Interview Advanced
Question

Why do Docker or NAT deployments gossip addresses the app cannot reach?

Answer:

replica-announce-ip and cluster-announce-ip exist because Docker hosts often gossip unreachable addresses. Failover then looks fine in CLUSTER NODES and dead from apps. Cluster is unforgiving of wrong advertised IPs.

Question 20
Interview Advanced
Question

What stalls a slot migration, and how do you unblock it?

Answer:

Slot migration stuck: a key that keeps being written during migrate, or a huge key, can stall a slot. UNLINK big keys first. CLUSTER GETKEYSINSLOT helps you see what is in the way.

Practice with AI mock interviews

Run Redis mock interviews with AI follow-ups, instant feedback, and analytics on AiLx.

Free to start · No credit card required