Weavr interview question

what's the optimistic locking and how to implement it?