Last active 5 days ago
interview
Interview prep notes
0
0
1
System Design Interview: Distributed Locks, Leases and Fencing Tokens
"How would you make sure only one worker processes this job?" is a common follow-up. A good answer covers leases and why a lock alone isn't enough.
The naive Redis lock
SET lock:job42 <random-token> NX PX 30000