Atlassian interview question

How to prevent dead lock?