Microsoft Interview Question

bit manipulations, string manuplations