Understanding byte order and endianness in systems programming
This is a hard-difficulty systems-level question that tests your understanding of endianness—how multi-byte values are arranged in memory. It appears frequently in networking and low-level systems interviews, particularly when candidates need to work with binary protocols, packet parsing, or cross-platform data serialization.
The question probes whether you can reason backwards from a memory representation to infer your machine's byte ordering. Firms like those in high-frequency trading and network infrastructure care deeply about this, since endianness bugs can silently corrupt data when values cross system boundaries or are read from network packets in the wrong byte order.
- Big-endian vs. little-endian representations
- Multi-byte integer storage in memory
- Platform-specific behaviour and portability
- Network byte order (NBO) and host byte order conversion