Design an Online Coding Contest Platform
Company: Whatnot
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Technical Screen
Design an online coding challenge platform that supports both regular practice problems and live contests.
Functional requirements:
- Users can browse problems, read statements, choose a programming language, submit code, and receive a verdict such as accepted, wrong answer, time limit exceeded, compile error, or runtime error.
- Users can view their submission history and basic problem statistics.
- Admins can create problems, upload hidden test cases, configure time and memory limits, and define supported languages.
- The platform supports contest mode: scheduled contests, participant registration, contest-specific submissions, scoring, rankings, and live leaderboards.
Non-functional requirements:
- User-submitted code is untrusted and must be executed safely.
- The judging system should be scalable enough to handle traffic spikes during contests.
- The system should provide reasonably low-latency feedback for normal submissions while preserving correctness and isolation.
- Discuss database choices and tradeoffs for storing users, problems, submissions, contests, test cases, and leaderboards.
Focus especially on how to safely run third-party submitted code.
Quick Answer: This question evaluates a candidate's ability to design a scalable, secure System Design for an online coding contest platform with emphasis on safely executing untrusted third-party code, testing competencies in distributed systems, sandboxing and isolation, job scheduling, and data modeling for submissions, contests, and leaderboards.