Judge0 is a code execution engine for coding platforms (like LeetCode). You send code + language + input -> Judge0 compiles/runs it safely -> returns output, errors, time, memory, exit staus.

Open-source service (you can self-host).
Provides REST API for:
run code
compile code
run with stdin
return stdout/stderr/time/memory/status
Supports many languages (C/C++, Java, Python, JS, Go, etc.).
Has community edition + hosted options.
So no, it is not a mysterious black box if self-hosted.
You can inspect code and control many settings.
When you call Judge0 API:
Submission created
You POST code +
language_id+ optionalstdin+ limits.Saved to DB
Submission gets a token (id-like key).
Queued
Job enters queue (Redis).
Worker picks job
Background worker takes one pending submission.
Sandbox run
Code runs in isolated environment (container + sandbox tools).
Resource limits enforced
CPU time, wall time, memory, output size, processes, etc.
Result stored
Status + stdout/stderr + compile output + metrics.
You fetch result
Poll by token until status is
Accepted/Runtime Error/ etc.

// Example with axios
const payload = {
source_code: "print(input())",
language_id: 71, // (example: Python 3 id may vary by image/version)
stdin: "hello"
};
const { data } = await axios.post(
"http://YOUR_JUDGE0_HOST/submissions?base64_encoded=false&wait=false",
payload
);
// data.token -> store this tokenconst { data } = await axios.get(
"http://YOUR_JUDGE0_HOST/submissions/${token}?base64_encoded=false"
);data.status.id, data.stdout, data.stderr, data.compile_output, data.time, data.memoryfrontend sends code to your backend
backend calls Judge0 (never expose secrets/internal endpoints directly if avoidable)
backend polls and returns final verdict to frontend
Judge0 enforces limits per submission:
time limit -> kills infinite loops
memory limit -> kills memory abuse
process/thread limit -> blocks fork bombs
output limits -> prevents huge stdout spam
optional network disable -> blocks internet misuse
isolated filesystem/runtime -> limits host access
This is why using a mature judge is much safer than DIY quick scripts.
0
2
0