← Whatnot Interview InsightsSoftware Engineer
This is one of those questions that sounds scoped but really isn't.
Start by clarifying functional and non-functional requirements, then design the core components: problem repository, code execution engine, submission and evaluation pipeline, and user progress tracking. Focus on scalability, security, and real-time feedback, and discuss trade-offs between different architectural choices.
Pro tip: Emphasize the importance of sandboxing and resource isolation for running untrusted code, as this is a critical and often overlooked aspect. Also, discuss how to handle peak loads during contests with horizontal scaling and queue-based processing.
Ask questions to understand the scope: expected number of users, types of problems (algorithmic, database, etc.), supported languages, and whether real-time collaboration or contests are needed.
Outline the main components: web/app servers, database, code execution service, message queue, and caching layer. Draw a simple diagram showing how they interact.
Detail the code execution engine: how to securely run untrusted code in isolated containers, manage resource limits, and scale horizontally. Discuss the submission pipeline: queuing, scheduling, and result aggregation.
Design schemas for problems, test cases, submissions, and user progress. Choose appropriate databases (e.g., relational for user data, object storage for test cases) and discuss indexing and sharding strategies.
Address scaling: caching, CDN for static assets, read replicas, and partitioning. Discuss trade-offs between consistency and availability, and between using VMs vs. containers for code execution.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.