InterviewLegend

Trees & Graphs

Alex Chen22 min readUpdated 139 real interview reports

Trees and graphs are a steady part of NVIDIA's coding loop, and three patterns carry most of the cluster. Count the connected regions in a grid: that's flood fill, asked straight. Find a Premium question of two nodes in a binary tree: that's tree recursion. Decide whether a set of prerequisite-bound tasks can be ordered at all: that's topological sort. All three live in the medium band, so the bar is correct, tested code that handles its edges, not a trick nobody has seen before.

These cluster together because each one reduces to a graph, and recognizing which graph is the only hard part. A grid of land and water is a graph where every cell connects to its four neighbors. A binary tree is a graph you walk by recursing into both children. A list of task prerequisites is a directed graph where an edge means "do this one first." NVIDIA's own work is full of this shape. A build of GPU kernels has dependencies, and a CUDA graph is a directed graph of operations that has to run in an order with no cycle. Once you see which graph you are looking at, the question becomes only which skeleton fits, and the rest is careful typing.

What's inside
  • 3 problems, worked step by step
  • 1 diagram
  • about 22 min

Premium lessonNVIDIA interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · Cancel anytime

Had your NVIDIA interview?Tell us what they asked. Reviewed before it goes in, never with your name.
NVIDIA interview guide

Know what NVIDIA asks before you walk in.

10 coding · 2 system design · 22 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.