CarGurus Interview Question

How to avoid dead lock