Pregunta de entrevista de FabHotels

What are optimistic and pessimistic locking?