Code RoomFollower reads with dynamic leadership
HardPrep Room Coding #3575

Follower reads with dynamic leadership

System designDistributed systemsSenior–Staff~50 min

A globally-distributed SQL database places each table-range's Raft leader in one region. A particular workload reads a hot, mostly-static reference range from all 6 regions but the range's leader is in us-east, so eu and ap readers pay a cross-region round-trip for every consistent read, and if us-east blips, leadership thrashes. The team wants (a) low-latency consistent reads from every region for this range and (b) to relocate leadership automatically toward wherever the write traffic actually is, without leadership flapping. Design the leadership + read strategy. Address how a follower can serve a consistent (not stale) read locally, and how you make leader placement adaptive without oscillation.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify5:30 left
Estimate5:30 planned
Design16:30 planned
Deep dive13:30 planned
Failure9:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.