Teradata interview question

How to resolve and avoid deadlock in software program