Logo

Coding preview

Peak GPU Memory Usage

What this preview is

About this preview

Peak GPU Memory Usage is a easy quant coding problem on language knowledge 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.

Practising this easy GPU memory profiling problem in Python

This is a straightforward easy coding problem that tests your ability to extract and track memory metrics from a time-series log. It is representative of the kind of practical instrumentation work that GPU-accelerated teams at firms like Nvidia encounter when building profiling and diagnostics tools.

The problem requires you to scan a sequence of memory readings and identify both the maximum value and the first time step at which it occurs. Clean solutions are simple and efficient: they typically iterate once through the input, maintain a running max, and return both the peak and its earliest position. The main nuance is handling the empty-list edge case correctly.

  • Single-pass iteration and state tracking
  • Index management in Python sequences
  • Handling boundary conditions