What this virtual memory addressing question tests
This is an easy foundational question on virtual memory and address translation, commonly asked during systems-level interviews at firms building infrastructure or trading systems with tight memory constraints. It tests whether you understand the relationship between page size and the bit-level mechanics of virtual-to-physical address mapping.
To solve problems in this area, you need to work backwards from the page size to determine how many bits are required to index within a page, then construct the appropriate mask for extracting the virtual page number. The key insight is recognizing that page size is always a power of two, which maps directly to bit positions.
- Page size and its encoding in bits
- Offset vs. page number fields in a virtual address
- Bitwise masking for address decomposition