Loading...
Loading...
Design an online coding platform similar to LeetCode, where users can browse programming problems, write solutions in multiple programming languages, submit their code, and receive feedback on their submissions. The platform should support coding interview preparation through a collection of problems with varying difficulty levels, from easy to hard.
The system must provide an interactive coding experience where users can open a problem, write a solution in their preferred supported language, and submit it for evaluation. Submission results should be returned within 5 seconds, allowing users to receive feedback quickly and continue improving their solutions.
A central challenge is executing user-submitted code securely while maintaining low response latency. Since the platform accepts code written by users, the execution environment must provide isolation and security. The system should support multiple programming languages without allowing submitted programs to compromise the platform or interfere with other users' executions.
The platform must also support periodic coding competitions where large numbers of participants submit solutions and monitor their performance through a live leaderboard. Competitions may involve up to 100,000 users, creating additional demand for code evaluation and real-time leaderboard updates.
The design focuses on problem discovery, multi-language code submission, execution feedback, and competition leaderboards. Authentication, user profiles, payments, analytics, and social features are outside the scope. Users are assumed to be authenticated, with their user identity available through an existing session or JWT.
Coding Problem Discovery: Users can browse a list of available coding problems. The platform should provide access to problems with different difficulty levels, including easy, medium, and hard.
Problem Viewing and Code Editing: Users can open individual coding problems, read their descriptions, and write solutions using multiple supported programming languages.
Code Submission and Evaluation: Users can submit their solutions for evaluation and receive feedback on the results. The system must execute submitted code in an isolated environment and return the evaluation outcome within 5 seconds.
Coding Competitions and Live Leaderboards: The platform supports coding competitions where participants solve problems and submit solutions. Users can view a live leaderboard reflecting competition results as they are updated.
High Availability: Prioritize system availability over strict consistency, ensuring that users can continue accessing problems, submitting code, and viewing competition results.
Secure Code Execution: Execute user-submitted code in isolated environments to protect the platform and prevent one user's execution from interfering with another user's code.
Submission Response Latency: Return code submission results within 5 seconds.
Competition Scalability: Support coding competitions with up to 100,000 participating users.
Multi-Language Execution: Support code submissions written in multiple programming languages while maintaining the required execution isolation and feedback latency.