Pergunta de entrevista da empresa Microsoft

Coding problem based on endianness.