Building a Leetcode clone backend
How I built an online judge system for remote code execution
LeetArxiv is Leetcode for implementing Arxiv papers — not silly data structures. This article highlights our backend architecture. Please share your feedback on Twitter.
This is the table of contents.
- Introduction to Online Judges and Remote Code Execution.
- Failed attempts at building a backend.
- LeetArxiv’s current backend. (as of December 1st 2024 with one solo programmer)

1. Introduction to Online Judges and Remote Code Execution
An Online Judge is a code compilation system that permits programmers to submit and test code online.
Remote Code Execution refers to running code on somebody else’s computer — not yours.
Some common Online Judge and Remote Code Execution systems include Leetcode, CodeChef, Judge0 and now, LeetArxiv.

2. Failed attempts at building an Online Judge backend
Here are 3 different approaches that failed.
- Using open-source Online Judges.
- Using Replit as a backend.
- Using WASM based compilers.
2.1. Why Open-Source Online Judges Failed
This sections showcases the shortcomings of different Online Judges we encountered.
- Judge0 — Difficult to extend supported languages.
- DMOJ Judge — AGPL license issues.
- QingDaoU Online Judge — Documentation is in Chinese.
2.2. Why Replit failed
We attempted to use Replit as our code execution backend. However, they changed their plans.
Before one could make unlimited REPLS. Now, one is limited to only 3 REPLS. Therefore, only 3 languages can be supported by Replit at any given time.

2.3. Using WASM based compilers
Our final approach was using WASM based compilers. This was our rational.
“Perhaps we should compile code to WASM and run it inside the programmer’s browser”
This was difficult. We found browser-based compilers for Zig, Go, Python and Java. However, we lacked the bandwidth to create compilers for languages like Haskell and Holy C. This approach did not align with our goal to support obscure languages.
3. LeetArxiv’s Current Backend
Our current backend is this Docker image. It’s an Ubuntu image with lots of different compilers. We host the image on Heroku and queue tasks with RabbitMQ.