← All questions
Coding
Bit manipulation
Asked at
Ciena
Infosys
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+
- 01Clarify integer width, signedness, and allowed operations.
- 02Express the required property as bits or masks.
- 03Use XOR for pair cancellation when applicable.
- 04Use shifts and masks with explicit bounds.
- 05Test zero, negatives, and high-bit cases.
Reference answer
Then expect these follow-ups
How do you isolate the lowest set bit?
Tests: follow-up reasoning
Why does x AND (x minus one) clear one bit?
Tests: correctness reasoning
Hiring now
Ciena has 130 open roles right now
landed applies to roles like these for you, on each company’s own site, with answers written for the role.
Get 5x interviews10 free auto-applies. No card.
Analyst, Treasury Operations
Gurugram
Executive Assistant – Thailand
Pathum Tani
Commercial Management, Japan
Tokyo
Next question