
95 (aka ninefive) is a distributed online judge system built to execute and validate user-submitted code against a set of predefined test cases. the original architecture was intentionally over-engineered for learning purposes: microservices, async communication, sandboxed execution, and more.
over time, this complexity became the bottleneck.
this article explains why i changed it, what i removed, and what improved.
in the original design, all code execution happened on the backend. the request lifecycle was defined by a long chain of synchronous and asynchronous handoffs:
stdout, stderr, and test case results.
- hybrid communication: we mixed synchronous rest calls (inter-service) with asynchronous rabbitmq jobs.
- database fragmentation: each microservice maintained its own schema in postgresql.
the core shift: "code execution does not need to happen on the server." by moving the runtime to the user's machine, we eliminated the need for heavy backend orchestration.
example of test definition - from "build your own shell" challenge:
{
"stageNumber": 0,
"stageName": "Print a prompt",
"testType": "cli_interactive",
"programConfig": {
"executable": "${user_program}",
"args": [],
"env": {}
},
"tests": [
{
"testName": "Shell prints dollar prompt",
"stdin": "\n",
"timeoutSeconds": 5,
"assertions": [
{
"type": "stdoutContains",
"value": "$",
"description": "Must print $ as prompt"
},
{
"type": "exitCode",
"expected": 0
}
]
}
]
}
we don't send the assertions to clients to avoid cheating.
local-first: leverages the user's local environment for all resource-intensive tasks.
$ 95 login
█████╗ ███████╗
██╔══██╗██╔════╝
╚██████║███████╗
╚═══██║╚════██║
█████╔╝███████║
╚════╝ ╚══════╝
Build your coding skills, one challenge at a time
Opening browser for GitHub authentication...
✓ Logged in successfully!
$ 95 init --cmd "python main.py"
✓ Config saved to .95.yaml
$ 95 test a85fdf04-a98e-4747-aa38-6e38babe663c
Stage 01: Handle echo command
├─ Echo simple string
$ echo hello
hello
├─ Echo email address
$ echo test@example.com
test@example.com
└─ Echo numbers
$ echo 123
123
$ 95 run a85fdf04-a98e-4747-aa38-6e38babe663c
Stage 01: Handle echo command
├─ ✓ Echo simple string
├─ ✓ Echo email address
└─ ✓ Echo numbers
✓ All 3 tests passed!
→ Check your browser for live progress updates and stage completion!
by the way, the cli tool is open source; feel welcome to contribute.
95 is still a work in progress. while my current priority is finding a job, i have many ideas for 95. spoiler: dungeons, hunters, and the shadow monarch are coming. get ready!