Interview practice question
Adding fencing to an existing system
System Design · Distributed Systems · Experienced
Your system uses ZooKeeper locks to ensure one writer per file in object storage, but you discover two writers sometimes overlap. How do you fix it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Lock expiry plus pauses allow overlap.
- Use lock version/zxid as fencing token.
- Storage must check token.
- Conditional writes (ETag/generation match).
- Or single-writer via ownership metadata.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.