Run and grade candidate code, safely
Build coding tests and interview tools without operating compiler servers. Submit each candidate solution with a test case as stdin, compare stdout to the expected output, and let CodeForge handle isolation, limits and failures.
Fair, consistent runs
Every submission runs in a clean, isolated sandbox with the same runtime versions and limits, so results don’t depend on which machine picked it up.
Clear outcomes per test
Distinct statuses for compile errors, runtime errors and timeouts make it easy to show candidates why a test failed.
Cheating-resistant by design
No network access means solutions can’t fetch answers or call external services during a run.
Safe retries at scale
Idempotency keys make retries free and duplicate-proof, even when your grader restarts mid-batch.
Grading a submission against test cases (Python, requests)
import os, time, uuid, requests
API = "https://api.tatvastack.com"
HEADERS = {"Authorization": f"Bearer {os.environ['CODEFORGE_API_KEY']}"}
def run(language, source, stdin):
r = requests.post(f"{API}/v1/executions", headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
json={"language": language, "source": source, "stdin": stdin, "limits": {"timeMs": 2000}})
r.raise_for_status()
eid = r.json()["executionId"]
while (res := requests.get(f"{API}/v1/executions/{eid}", headers=HEADERS).json())["status"] in ("QUEUED", "RUNNING"):
time.sleep(0.5)
return res
tests = [("2 3", "5"), ("10 -4", "6"), ("0 0", "0")]
solution = "a, b = map(int, input().split())\nprint(a + b)"
for stdin, expected in tests:
r = run("python", solution, stdin)
verdict = "PASS" if r["status"] == "SUCCEEDED" and r["stdout"].strip() == expected else r["status"]
print(stdin, "->", verdict)
Works the same for Python, JavaScript, Java and C++: change the language field. Full reference in the API docs.
Questions from coding assessments teams
How do I check a solution against test cases?
Send the same source once per test case with that case as stdin, then compare stdout with the expected output. Run time and exit code are returned with every result.
What stops a candidate’s code from cheating?
Sandboxes have no network route and no DNS, no cloud credentials, and strict time and memory limits. Each run starts clean.
Can I run many submissions in parallel?
Yes, up to your plan’s concurrency limit; additional requests get a retryable CONCURRENCY_LIMIT response.
Built for coding assessments
500 free runs a month during the beta. No servers to manage.