Pregunta de entrevista de Microsoft

Typical programming questions, (math-oriented).