Top 3 Clock skew Interview Questions
Browse 3 real-world technical and behavioral interview questions about Clock skew. Review scenarios, edge cases, and architectural best practices.
Design a distributed job scheduler that runs every job once, and on time, even when workers die.
A distributed job scheduler cannot promise exactly-once execution when workers die mid-job, so it promises at-least-once with idempotent jobs. Materialise each firing as a run row, claim it with a lease and heartbeats, judge time by one clock, and key side effects on job id plus scheduled time.
One machine's clock is ninety seconds ahead of the rest of the plant. Which of your numbers are wrong, and how would you have found out?
Every derived figure that joins on time is affected, and none of them error. Duration and attribution metrics take the skew directly, so a shift with twelve stops mis-measures availability by nearly four points, and only storing both event time and ingestion time makes the offset visible.
Two servers each write a record stamped with its own clock. Why can you not use those timestamps to decide which write happened first, and what do you use instead?
Wall clocks on separate machines disagree by an unbounded amount and can jump backwards, so their timestamps order events by accident rather than by causality. Logical and vector clocks capture what preceded what, quorums give overlap not order, and a lease is safe only with a fencing token.