Pregunta de entrevista de Microsoft

Coding problem based on endianness.