Revolut Interview Question

Compare optimistic vs pessimistic DB locking and when to use?