Pergunta de entrevista da empresa FabHotels

What are optimistic and pessimistic locking?