Bit Manipulation & Masks
Bit manipulation comes up at NVIDIA more often than at most software companies, and most of it lands in the online assessment. The problems are short. One asks whether two memory addresses sit on the same 4 KB page, another has you reverse a range of bit positions in a 32-bit value in constant time, and a third gives you a running XOR and wants back the array that produced it. None of them runs past a dozen lines of code. What decides them is the word width, the off-by-one at a page edge and whether you can explain why the mask works.
These problems come from everyday driver and CUDA work, where code maps memory in fixed-size pages and rewrites one field of a hardware register without touching its neighbours. Interviewers who write that code read a clean mask as a sign you've done the same, and they notice a mask built in the wrong width quickly. Some systems teams run the assessment in C only. Practice these in C or C++ as well as in Python.
~0xFFFu is a 32-bit unsigned int, and widening it to 64 bits zero-extends away every page-number bit above bit 31. A Java int keeps its sign in bit 31, so >> drags copies of it down unless you write >>>.
So name the type that holds the value, build the mask in that type, and say so as you type it. If you skip that, an interviewer who works on driver code may ask what ~ does to a 64-bit address.NVIDIAPremium lesson · Coding round
The 3 NVIDIA problems are below.
- A Premium questionCoding · Easy · Signature problem
- A Premium questionCoding · Medium
- A Premium questionCoding · Medium
Each with hints, the follow-up and a tested solution.
Get the NVIDIA questions$49 a year · all 100 companies · cancel anytime
From 139 NVIDIA reports, forum threads behind logins and write-ups in Chinese.
NVIDIA interview guideKnow what NVIDIA asks before you walk in.
23 coding · 2 system design · 22 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.