This question evaluates a candidate's understanding of distributed coordination and leader election using a central in-memory datastore, focusing on lease-based leadership, failover, and correctness under partitions and clock skew.
You have N stateless service instances running the same job. At any time, exactly one instance should act as the leader (performing a singleton task), and the rest should be followers/standby.
You are allowed to use Redis as a coordination dependency (single primary Redis endpoint is fine for the interview). You may use any Redis features you want (e.g., SET NX PX, Lua scripts, Pub/Sub).
Login required