System Design Lab
Online Judge scaling is mostly worker economics, not API traffic.
Move the sliders from a toy judge to a LeetCode-like workload. The design changes when compilation and sandboxed execution dominate: submit asynchronously, queue work, prewarm containers, cache immutable results, and split heavy submit from light run-code traffic.
Normal evolution scenarios
Click left to right for the intended demo path. Each card changes the workload inputs.
Recommended shape
Bottlenecks
Why this changes
Decision tradeoffs
Source-backed rules
These are the durable system-design claims behind the model. The exact slider thresholds are deliberately labeled as teaching assumptions.
Container resource limits are the unit of TLE and MLE enforcement
CPU and memory limits give worker infrastructure a concrete way to stop submissions that exceed problem constraints.
Docker DocsSeccomp reduces the syscall surface for untrusted code
A sandbox should block dangerous system calls instead of merely trusting language runtimes or process permissions.
Docker DocsQueues decouple submit traffic from worker execution
A queue absorbs bursts and lets workers consume at their own pace, which matches asynchronous judging.
AWS SQS DocsTTL-backed key-value results make polling cheap
A final verdict is immutable, so short polling can read a small cached object until the key expires.
Redis DocsTeaching assumptions
- Worker slot thresholds are teaching thresholds; real capacity depends on language mix, testcase size, CPU model, and isolation overhead.
- The result cache stores final or in-progress verdict objects, not the source code blob.
- Kafka is deliberately not required here unless the design needs replay, analytics fanout, or multiple consumers.