Revolut interview question

Differences for pessimictic and optimistic lock