Layer 3 · Go deeper · 9 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Back of the envelope
Size it up
Tap through each step of the arithmetic.
A node restarts for 10 minutes. How long do its hints take?
What does one lightweight-transaction write cost across regions?
Build-up · 6 steps
Follow one write and one read
N = 3, W = 2, R = 2. One client writes, another reads, and one replica missed the write.
Step 1 of 6
Three homes for key k
The key is hashed onto the ring; its preference list is the next N = 3 distinct nodes clockwise. Every node can compute that list, so any node can take a request.
4 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 4
Interviewer
“Mumbai and Frankfurt hold three replicas each. Users are homed to one region. Which consistency level should their reads and writes use?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“Two devices edit the same shopping cart at once, through different coordinators. Neither saw the other’s write. Which version do you keep?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“A replica was down for a day when a row was deleted. Your team runs nodetool repair once a month. What do you change?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“Two people claim the username priya_k at the same moment. On Cassandra, how do you make sure only one gets it?”
Your move. Pick an approach:
Build-up · 6 steps
Find the one range that differs
Read repair fixes only keys someone reads, and hints expire. Anti-entropy compares whole replicas by hashing, not by shipping every key.
Step 1 of 6
Hash ranges into a tree
Each leaf is a hash of one slice of a token range, and each parent is a hash of its children. Both replicas build a tree for the same range.