X interview question

Bit manipulation