Walk an x86-64 Four-Level Page Table With Huge Pages

Last updated: November 29, 2026

Quick Overview

Given a model of physical memory holding page tables and a CR3 value, translate a 64-bit virtual address through PML4, PDPT, PD and PT entries, honoring present, writable and user bits and 1 GB and 2 MB huge pages, raising a page fault where hardware would.

Intel
Software Engineering Fundamentals
Software Engineer
Intel
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Medium

0

0

0 solved


Given a model of physical memory holding page tables and a CR3 value, translate a 64-bit virtual address through PML4, PDPT, PD and PT entries, honoring present, writable and user bits and 1 GB and 2 MB huge pages, raising a page fault where hardware would.

Intel architecture, virtualization and kernel teams expect engineers to know how the MMU translates addresses, since it drives TLB behavior, VT-x nested paging and memory performance work. The interviewer checks index extraction, huge-page handling and permission checks at every level.

What the Interviewer Expects
  • Extracts 9-bit indices at shifts 39, 30, 21 and 12
  • Checks the canonical address rule for 48-bit addressing
  • Stops early on PS bit at the PDPT (1 GB) or PD (2 MB) level and uses the right offset width
  • Applies present, writable and user checks at each level
  • Explains the role of the TLB and what invalidation is needed after changing an entry
Key Topics to Cover
Virtual memory
Page tables
Huge pages
TLB
x86-64 architecture
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • How does five-level paging (LA57) change the walk?
  • With EPT under VT-x, how many memory accesses can a single guest TLB miss cost in the worst case?
  • When would you choose 2 MB pages for a database buffer pool, and what are the downsides?
  • How does PCID reduce the cost of context switches?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Memory is a dict from table physical base to a list of 512 entries. Entry bits: 0 present, 1 writable, 2 user, 7 page size. Bits 12 to 51 hold the next table or page frame. Return the physical address...

High-Level Design

With 4 KB pages a 48-bit address splits into four 9-bit indices and a 12-bit offset. At each level read the entry, check permissions, and either descend to the next table or, if PS is set at the 1 GB ...


Submit Your Answer
Markdown supported

Related Questions