Logo

Coding preview

Deadlock Detection in a Resource Allocation Graph

What this preview is

About this preview

Deadlock Detection in a Resource Allocation Graph is a hard quant coding problem on operating systems in Python, asked at Nvidia.

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.

Detecting deadlock in multi-resource systems using the Banker's Algorithm

This hard coding problem tests your ability to implement a classic operating-system safety check used in GPU-accelerated systems and other environments where multiple processes compete for shared resources. It is the kind of problem that appears in systems-engineering rounds at infrastructure-heavy firms like NVIDIA.

The core challenge is distinguishing between a deadlocked state and a safe one when resource types have multiple instances

  • Simulating resource allocation and release
  • Greedy search for a safe execution order
  • Computing and updating the need matrix
  • Distinguishing safe states from unsafe (deadlocked) states