Microsoft Interview Question

Coding problem based on endianness.