NVIDIA Senior coding interview questions
These are the 6 coding questions YourAlly has tagged for NVIDIA at Senior. On the YourAlly ladder this is Senior, the same level as Google L5, Meta E5 and Amazon L6.
A coding round at a large tech company usually runs 45 to 60 minutes with one or two problems. You write code that runs, test it on your own examples and state its time and space cost. At this level the bar is a correct, tested solution you reach mostly on your own, with the trade-offs said out loud.
Practice a mock NVIDIA Senior coding loopPractice NVIDIA coding questions
Buddy Allocator for Device MemoryFree to read
Implement a buddy allocator over a pool of total_size bytes. An alloc rounds up to a power of two no smaller than min_block, takes the smallest free block size that fits at its lowest offset, and splits it in halves as needed. A free merges a block with its buddy while the buddy is free. Return the offset for each alloc, or -1 if it fails.
Input: total_size = 16, min_block = 4, ops = [alloc,alloc,free,free,alloc], args = [4,4,0,1,16] Output: [0,4,0]
What a strong answer covers
- Per-size free lists with lowest-offset selection
- Splitting larger blocks and returning upper halves to free lists
- Buddy found with offset XOR size and merged repeatedly
- Safe handling of double free and free of a failed alloc
- Discussion of internal fragmentation trade-off
5 more coding questions
- Convert COO Entries to CSR Locked
- Dynamic Batcher Completion Times Locked
- Pipeline Stages Under a Memory Cap Locked
- Shared Memory Bank Transactions Locked
- Stream Kernel Makespan Locked
Related pages
More NVIDIA Senior rounds
- System design 4 questions
- Behavioral 29 questions
NVIDIA coding at other levels
- Staff 3 questions
- Senior staff 3 questions
Other companies at this level
- Adobe Senior 7 questions
- Airbnb Senior 4 questions
- Amazon L6 10 questions
- Anthropic Senior 6 questions
- Apple Senior 7 questions
- Cisco Senior 6 questions