Explain deadlock cases and how to prevent them | Microsoft Interview Question