Nvidia SDE Interview Question 2022 March | Trie & Bit Manipulation | Off-campus

Nvidia · Question · Posted Jun 2026

Question 1: Maximum XOR of Two Numbers in an Array Problem Statement Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n. An O(N^2) algorithm checking all pairs will fail due to strict time constraints. You must find an O(N) algorithm. Constraints 1 <= nums.length <= 2 * 105 0 <= nums[i] <= 231 - 1 Example Input: nums = [3,10,5,25,2,8] Output: 28 Explanation: The absolute maximum XOR is ...

The full answer & interview discussion are available to premium members.

Log in Create a free account