Design a Distributed Lock and Coordination Service Like Chubby

Last updated: November 29, 2026

Quick Overview

Design a highly available coordination service that offers locks, leader election, and small configuration files to thousands of internal Google services.

Google
System Design
Software Engineer
Google
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design a highly available coordination service that offers locks, leader election, and small configuration files to thousands of internal Google services.

Coordination services sit under many Google systems, and this question checks understanding of consensus, leases, and the subtle problem of clients acting on expired locks. It is a favorite for senior candidates.

What the Interviewer Expects
  • Uses a consensus protocol for a replicated state machine
  • Explains sessions, leases, and keepalives
  • Introduces fencing tokens for safety
  • Designs client caching with invalidation
  • Plans for scale via proxies and read patterns
Key Topics to Cover
consensus
Paxos/Raft
leases
fencing tokens
leader election
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • What happens if a client pauses for 30 seconds while holding a lock?
  • How does a new master avoid violating existing leases?
  • Why offer coarse-grained locks instead of fine-grained ones?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: a small hierarchical namespace of files; acquire and release exclusive or shared locks on files; watch for changes; sessions that release locks when a client dies; leader election via ...

High-Level Design
  1. A cell of five replicas runs a consensus protocol (Paxos or Raft) to replicate a log of operations; one replica is master and serves all reads and writes.
  2. Clients open a session with the...

Submit Your Answer
Markdown supported