← Back
engineeringNov 15, 2024

Building Scalable Online Judge Systems: Lessons from RoboContest

How we designed and built an online judge system that handles thousands of concurrent code submissions securely and efficiently using Docker containers and Redis queues.

S

Sardor Nematov

Senior Backend Developer

The Challenge of Secure Code Execution

When we set out to build RoboContest, one of our biggest challenges was executing untrusted user code safely. Every submission could potentially contain malicious code — from fork bombs to network exploits. We needed a sandboxed execution environment that was both secure and performant.

Docker-based Sandboxing

Our solution uses ephemeral Docker containers for each submission. Each container runs with strict resource limits (CPU, memory, network access disabled) and is destroyed after execution. This approach gives us complete isolation while supporting 10+ programming languages.

Queue Architecture

We implemented a priority queue system using Redis that handles burst traffic during contests. Submissions are distributed across worker nodes, and results are pushed back via WebSockets for real-time feedback.

Lessons Learned

After serving 50,000+ users and processing millions of submissions, we learned that the key to scaling online judges is not raw compute power — it is smart resource allocation and aggressive caching of test case results.