Microsoft interview question

Question that tests your coding knowledge instead of full data structure.