Logo

Coding preview

Address Translation 2

What this preview is

About this preview

Address Translation 2 is a medium quant coding problem on computer architecture in Cpp.

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.

Implementing a multi-process TLB with ASID isolation

This is a medium C++ coding problem that tests your understanding of virtual-memory translation in multi-process systems. It asks you to build a VIVT (Virtually Indexed, Virtually Tagged) TLB simulator that handles the homonym problem—the fact that different processes can use the same virtual address to mean different physical locations.

The core challenge is implementing correct isolation between address spaces using ASIDs (Address Space Identifiers), while also supporting global entries that must be accessible from any process. You need to manage lookup priority (ASID-specific entries before global fallbacks), handle entry insertion and invalidation correctly, and ensure your data structures support both fast translation queries and selective flushing. With up to one million translation calls, efficiency matters.

  • Virtual-to-physical address decomposition (VPN and page offset)
  • Multi-key TLB lookup: (ASID, VPN) as the translation key
  • Global vs. ASID-specific entry semantics
  • Selective invalidation (per-ASID vs. full flush)