The Desi Architect
Notes / Design Interview Problems / Design LeetCode / HackerRank (Code Execution Sandbox & Online Judge)
Track 5 · Design Interview Problems

Design LeetCode / HackerRank (Code Execution Sandbox & Online Judge)

Safely compiling and executing arbitrary, untrusted user code under two-second time limits and strict memory caps. How an online judge isolates execution using gVisor and seccomp, differentiates CPU time from wall-clock time, prevents fork bombs with cgroups v2, and defends worker nodes from infinite output denial of service.

Interview problem25 min read
On this page
  1. The hiring assessment that wiped out a worker cluster
  2. 🟢 Layer 1: Core Mechanics & High-Level Architecture
  3. 🟡 Layer 2: Deep Dive into the Sandbox Defense Matrix
  4. 🔴 Layer 3: CPU Time vs Wall-Clock Time & DoS Prevention
  5. The Complete Verdict State Machine
  6. The Decision Matrix
  7. Cross-Questions & Deep Dives