Engineering Code Lab · JavaScript in your browser
Code that measures, filters and controls.
32 short programming problems pulled straight from engineering: average a sensor, debounce a button, find a root, tune a PID loop, fit a calibration line. Each has starter code, automated tests (some hidden), hints that unlock one at a time, and an explanation once you solve it.
How the sandbox keeps you safe
- runs in your browserNever on a server.
- no networkThe sandbox cannot fetch, post or open sockets.
- 3 s limitInfinite loops are stopped, not frozen.
- nothing uploadedDrafts stay in this browser.
Level 4: Systems Engineer
10 exercises also come as a buggy version to fix: guided debugging, the way real engineering often starts.
Levels describe what you can already do, not your age.
- □ L4 · Numerical methodsBisection root finderSolve f(x) = 0 for a polynomial by repeatedly halving an interval that contains the root.iteration to a tolerance🐞 debug variant
- □ L4 · MechanicsEuler integration of a falling objectStep a falling object's velocity forward in time with air drag and watch it approach terminal velocity.numerical integrationplots
- □ L4 · Control systemsPID step responseSimulate a PID controller driving a first-order system and see why integral action removes steady-state error.feedback loopsplots
- □ L4 · MeasurementCalibrate with a least-squares lineFit the best straight line through noisy calibration data for a load cell.statisticsplots
- □ L4 · Computer systemsCount cache hitsSimulate a small least-recently-used cache and count hits and misses for a stream of requests.simulation with arrays🐞 debug variant
- □ L4 · RoboticsCheapest path across a gridFind the lowest energy route for a rover across a terrain grid, moving only right or down.dynamic programming🐞 debug variant
- □ L4 · CommunicationsHamming(7,4) error correctionEncode four data bits with three parity bits, then find and fix a single flipped bit.parity and XOR
How it works
- Write in the editor: Tab indents, Ctrl/⌘ + Enter runs.
- Run to see
console.logoutput, line charts fromplot(xs, ys, "label"), or a step-by-step sorting and searching visualiser. - Check to run the visible and hidden tests. Hidden tests show pass or fail, never the expected answer.
- Stuck? Hints unlock one at a time. Nothing is timed and nothing is ranked.