DesignTheSystem/dev

How grading works

What the simulator measures, how code is graded, and how we check that the grading itself is right.

DesignTheSystem is a place to practise. It doesn't replace the courses and books where you learn the ideas; it is where you find out whether you can use them. So the grading has to be something you can trust. Here is exactly how it works, including what it leaves out.

System design: the simulator

Every problem has a traffic profile: a peak rate of requests per second, the share of them that are reads, and a spike on top of the peak. Your design gets a 60-second run of that traffic. Each component you place has a capacity (reads and writes it can serve per second), a time per request when it is idle, and a monthly price. As a component gets busier, requests queue and latency climbs; past its capacity, requests time out and fail.

A run passes when all of these hold at once:

Beyond pass or fail, the result names the busiest component, shows each component's load, and lists design checks an interviewer would expect for that kind of system, such as a cache for read-heavy traffic. Those checks count toward your grade, not toward passing.

Where the numbers come from

Capacities, latencies and prices are round teaching values, close enough to real hardware that the trade-offs come out the right way round: memory is far faster than a database, a database takes fewer writes than reads, a single hot row can take only so many updates a second. They are not a benchmark of any particular cloud provider, and your production numbers will differ. Every component's numbers are shown on its info card, so nothing is hidden.

What it does not model

The simulator models load, queueing, caching, replication, partitioning and queues, and lets you inject faults: a server crashing, a database primary failing, a cache being flushed and a whole zone going down. It does not run your queries, model network partitions between regions, or account for things like garbage collection pauses or a bad deploy. Use it to see how a shape of system behaves under load, then reason about the rest the way you would in an interview.

Code design: tests, not opinions

Code design problems give you an interface to implement in TypeScript. Your code runs in a sandbox with no access to the network or the machine. A problem is passed when every test passes: the public tests you can see, hidden tests for edge cases, and then a change request that adds a new requirement.

On top of pass or fail, you get a grade out of 100:

How we check the grading

A grader that marks good answers wrong is worse than none, so the grading itself is covered by automated tests that run on every change to the site:

If you think something is graded wrong, it is a bug, and I want to know: report it or email creator@designthesystem.dev.

Where to learn the ideas

These are the resources I'd recommend for learning the theory. DesignTheSystem is not affiliated with any of them; they are simply good.