Microsoft interview question

As usual programming questions.