Persistent Systems Interview Question

How to prevent deadlock