Find the one element that appears once while every other appears twice. The XOR bit trick delivers O(n) time and O(1) space — no extra memory, no sorting. Master the three XOR properties that make it work, then see how interviewers escalate to Single Number II and III.
LeetCode 268 hides four distinct valid solutions behind a deceptively simple problem. Learn Sort, HashSet, Gauss Formula, and XOR — understand exactly why each exists, when interviewers ask for each one, and why XOR is the most elegant answer in the room.
LC 78 is the gateway to every combination and permutation problem in FAANG interviews. Master all three approaches — backtracking, bitmask enumeration, and iterative cascading — with deep visual dry runs, real interview follow-ups, and line-by-line Python and JavaScript solutions.
Find the one non-duplicate element in O(log n) time by observing how pair indices shift after the singleton — a parity-based binary search that requires no XOR or extra space.
Master bit manipulation for FAANG interviews: XOR tricks, popcount, bitmask DP, Brian Kernighan, two-complement identities, and 5-language operator reference with full problem index.
LC 136 Single Number is the canonical XOR interview problem. Every duplicate cancels itself via a^a=0, leaving only the unique element. Master this identity and every follow-up variant before your next coding screen.
LC 137 Single Number II extends XOR cancellation to triplets. Learn the ones/twos state machine and the mod-3 bit count, two approaches every FAANG interviewer expects you to derive from scratch.
LeetCode 260 Single Number III: every element appears twice except two unique elements. Master the XOR partition trick used by FAANG interviewers to test deep bitwise reasoning.
LeetCode 191 Number of 1 Bits: count set bits using Brian Kernighan trick n & (n-1). Foundational popcount technique that every FAANG interviewer expects you to know cold.
LeetCode 338 Counting Bits: compute popcount for every integer 0..n in O(n). Master the elegant DP recurrence dp[i] = dp[i >> 1] + (i & 1) that FAANG interviewers love.
LeetCode 190 Reverse Bits: reverse the binary representation of a 32-bit unsigned integer. Master the shift loop and the elegant divide-and-conquer mask reversal used in real-world DSP and crypto code.
LeetCode 268 Missing Number: find the one missing integer in [0..n] using XOR cancellation or the Gauss arithmetic-series formula. Two O(n) techniques every FAANG interviewer expects you to compare.
LeetCode 371 Sum of Two Integers: add integers using only XOR and AND. Master the half-adder, carry propagation, and two's complement trick that reveals how CPUs actually compute sums.
LeetCode 78 Subsets: enumerate the power set with bitmask iteration. Master the elegant 2^n bit-loop FAANG interviewers prefer over recursion for its clarity and speed.
LeetCode 698 Partition to K Equal Sum Subsets: decide if an array can be split into k equal-sum buckets. Master the bitmask DP that converts an exponential DFS into a clean O(2^n * n) solution loved by FAANG interviewers.
LeetCode 477 Total Hamming Distance: sum bit-differences across every pair in linear time. Master the per-bit contribution trick that turns O(n^2) brute force into O(n) — a FAANG favorite.
LeetCode 201 Bitwise AND of Numbers Range: AND every integer in [left, right] in O(log n). Master the common-prefix observation FAANG interviewers expect — far smarter than the obvious O(range) loop.
LeetCode 1879 Minimum XOR Sum of Two Arrays — pair every element of nums1 with a unique element of nums2 to minimize total XOR. Bitmask DP turns assignment into a 2^n state space. Step-by-step bit manipulation walkthrough for FAANG interviews.
LeetCode 89 Gray Code — generate an n-bit sequence where consecutive numbers differ by exactly one bit. The one-line XOR formula gray(i) = i XOR (i shifted right by 1) cracks it. FAANG-favorite bit manipulation interview problem.
LeetCode 187 Repeated DNA Sequences — find every 10-letter substring that appears twice or more. Encode each nucleotide in 2 bits, slide a 20-bit window with shift and AND. Linear-time bit manipulation interview classic.
LeetCode 1178 Number of Valid Words for Each Puzzle — count words containing the puzzle’s first letter using only puzzle letters. The 26-bit bitmask plus the (sub - 1) AND parent submask trick crushes a brute-force quadratic solution.
LeetCode 318 Maximum Product of Word Lengths — find two words sharing no letters with maximum length product. Encode each word as a 26-bit set, then check disjointness with one bitwise AND. The textbook FAANG bitmask interview problem.
Complete bit manipulation cheatsheet for FAANG interviews: all critical tricks, bitmask DP patterns, XOR properties, complexity table, and full problem index across 18 problems.
LC 1290 Convert Binary Number in a Linked List to Integer is an easy interview problem that combines linked list traversal with binary number conversion. Learn the elegant bit-shift accumulation pattern with Python and JavaScript solutions, dry run, and interview tips.
Bit manipulation is the cheat code of competitive programming and tier-1 interviews. Master the XOR identities, n & (n-1) tricks, subset enumeration over a bitmask, and bitmask DP techniques that turn O(2^n) brute force into elegant constant-factor wins.
LeetCode 421 — find the maximum XOR pair in an array of integers in O(N times 32) using a binary trie. The classic introduction to bit-trie pattern that powers competitive programming and database query optimisers.