Handshake interview question

How does one debug race conditions?