Microsoft interview question

bit manipulations, string manuplations