If two devices edit the same record while offline and both sync later, how would a last-write-wins strategy resolve the conflict, and what are its downsides?

technical-conceptual · Junior level · software-engineering

What the interviewer is really asking

Assesses understanding of conflict resolution: how last-write-wins works, when it's acceptable, and the data-loss and clock-skew pitfalls it introduces.

What to say

What to avoid

Example answers

Strong: Last-write-wins attaches a timestamp or version to each edit and keeps whichever is newer, dropping the other. The risk is silent data loss: one user's change just disappears. It's acceptable for a single-user setting like a profile preference, but for shared data I'd prefer field-level merge or a server-assigned timestamp, because device clocks drift and a local wall-clock can crown the wrong winner.

Weak: Last-write-wins just keeps the latest change, which is what you want anyway since the newest data is the most correct. I'd compare the timestamps from each device and keep the bigger one.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.