Yelp interview question

How to resolve a deadlock