Amazon interview question

Question about locks.