Design of the LeetCode System

Lesson 179 of 25614 min readPremium lesson preview
In this lesson1 sections

Design of the LeetCode System

Follow a submission from durable acceptance through isolated execution to a versioned verdict. The design must also recover a lost worker without counting one submission twice or exposing hidden tests.

This is a proposed LeetCode-like architecture. It combines an execution pipeline with content, contest, history, and discussion services; it is not a verified inventory of LeetCode’s infrastructure.

Let’s start with the high-level design.

High-level design of LeetCode

The following diagram illustrates the high-level architecture of the system:

High-level design of the LeetCode system
High-level design of the LeetCode system

The core components of this system are detailed below:

The rest of this lesson is for Premium members

Premium opens every lesson in this course, along with all questions and solutions on PracHub.