Skip to content
DSA Studio
Search
Home
Sign in
Bit Manipulation Checkpoint
Bit tricks, XOR, and per-bit reasoning.
1. What does n & (n - 1) do?
Clears the lowest set bit
Sets the lowest set bit
Flips all bits
Extracts the highest set bit
2. If every number appears twice except one, XOR of all numbers yields:
The unique number
Zero always
The maximum number
The minimum number
3. Condition for n to be a power of two (for n > 0)?
4. The AND of all numbers in [left, right] keeps the:
Common binary prefix
Common suffix
XOR of ends
Sum of bits
5. If a target OR bit is 0, you must:
Flip any 1 bits in a or b at that position
Set at least one bit to 1
Leave both bits unchanged
Flip only in c
Submit quiz
Auto-advance on pass
Join Discord
×