Microsoft Interview Question

A problem related to bit-wise manipulation