Design an Online Judge and Live Comments
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Onsite
The onsite included two system design prompts:
1. Design an online judge platform where users submit code for programming problems. The system must support multiple languages, compile and run untrusted code in isolation, evaluate submissions against public and hidden test cases, enforce time and memory limits, and return verdicts such as Accepted, Wrong Answer, Runtime Error, and Time Limit Exceeded. Discuss APIs, storage, worker scheduling, sandboxing, burst handling during contests, and security.
2. Design a live-comment feature for a social media post. Users viewing a popular post should see new comments appear with very low latency. Explain the write path, read path, comment ordering, moderation, and how clients receive updates. Compare long polling, Server-Sent Events, and WebSockets, and discuss how to handle hot posts with very high fan-out.
Quick Answer: This question evaluates skills in designing scalable, secure distributed systems, covering execution sandboxing, multi-language code evaluation, worker scheduling and test-case management for an online judge, alongside low-latency publish/subscribe, fan-out, ordering and moderation strategies for a live-comment feature.