Microsoft interview question

The interview was mostly on algorithms and problem solving. Had to write code on the white board while solving the problem.