← All questions
Coding
Bit Manipulation Based
Asked at
ExpediaHHashedIn
1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below
0
Stuck? Show a way to structure it+
- 01Confirm value range, signedness, and frequency guarantees.
- 02Map each requirement to a bitwise property.
- 03Choose masks, XOR, shifts, or per-bit counts.
- 04State the bit invariant.
- 05Verify high-bit and zero cases.
Reference answer
Then expect these follow-ups
How do per-bit counts solve the thrice-except-once variant?
Tests: constraint adaptation
When should you use a BitSet instead of an integer mask?
Tests: follow-up reasoning
Free to read · better with Enzo
Practice this out loud with Enzo
Enzo runs it as a mock interview, pushes back with follow-ups, and grades you on the rubric.
Next question