Bit Manipulation — Reasoning Check

Apply the module invariants, traces, and boundary conditions.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. Under this pack's leading-width-preserving AddBinary contract, what string results from "0011" + "0001"? Enter the four binary digits without quotes.
2. Reverse all 32 bit positions of uint32(2), not just its significant digits. What is the result as an unsigned decimal integer?
3. Let x be binary 1101000, or decimal 104. What does one execution of x = x & (x-1) produce?

Select one answer.

4. Every repeated value appears three times in [5,5,5,7]. Why does XORing the entire array fail to recover the singleton?

Select one answer.

5. SingleNumberII reconstructs the 32-bit pattern 0xFFFFFFF9 after taking bit counts modulo three. Under its signed-32-bit result interpretation, what must be returned?

Select one answer.

6. What is the bitwise AND of every integer in the inclusive range [9,11]?

Select one answer.

Join Discord