Day 17 - Bit ManipulationPractice QuestionsOverview

Bit Manipulation Practice Questions

Six classic interview problems where bit manipulation isn’t an optimization — it’s the idea. Each one collapses to a few lines once you see the bit-level structure.

For every problem, ask first: “what’s the bit pattern of the answer?” Once you can describe the answer in terms of which bits are set, the code writes itself in three or four lines.

Easy

ProblemPatternStatus
Single NumberXOR cancels pairsAvailable
Number of 1 BitsKernighan / popcountAvailable
Power of Twox & (x-1) == 0Available
Missing NumberXOR with indexAvailable

Medium

ProblemPatternStatus
Counting BitsDP with low bitAvailable
Reverse BitsShift + placeAvailable

More Practice (Coming Soon)

ProblemPatternStatus
Single Number IIBit-by-bit count mod 3Coming Soon
Single Number IIIXOR + bit isolationComing Soon
Sum of Two IntegersXOR + AND carryComing Soon
Bitwise AND of RangeCommon prefixComing Soon
Maximum XOR of Two NumbersTrie of bitsComing Soon
Subsets via BitmaskEnumerate 2^nComing Soon