<aside>
šš»āāļø System Design: Online Judge for coding contests.
The above video is pretty scant on details and rigor. Would like further resources to validate my solution to this problem.
</aside>
1. Problem definition: use cases and constraints
Gather requirements and scope the problem. Ask questions to clarify use cases and constraints. Discuss assumptions.
Take code from users across the world, and test whether their submitted code is passing all test cases or failing some test cases.
Use cases
š Without an interviewer to address clarifying questions, we'll define some use cases and constraints.
We'll scope the problem to handle only the following use cases
- User can submit code in multiple languages (Python, Java, C++, Javascript ...) to be evaluated for correctness and performance on a problem. They receive a pass or failure rating.
Out of scope
- UserĀ registers for an account
- UserĀ logs into a registered account
- System management of question bank.
- Front-end.
Constraints and assumptions
- The Youtube video provide no clear constraints, so Iāll make them up.
- Traffic is not evenly distributed. Some customers are heavy users, some arenāt. During a competition, traffic will be highest.
- Website has 1 million active users
- 100 code submissions per active user per month ā 100 million
- 100 code submissions per second, at peak
- API must be high-availability during competitions, at peak load.