This was a lot to hold in your head at once.
Start by clarifying requirements and constraints (e.g., scale, security, latency) with the interviewer. Then present a high-level architecture covering API design, execution flow, and sandboxing, and dive into trade-offs for each component. Finish by discussing operational concerns like monitoring and failure handling.
Pro tip: Emphasize security and isolation early, as executing user-provided code is the biggest risk. Show you understand that sandboxing and resource limits are non-negotiable for a production system.
Ask questions to understand expected scale, latency, security requirements, and supported languages. Confirm whether the service is multi-tenant and what level of isolation is needed.
Define endpoints for uploading JARs, submitting executions, fetching logs/results, and cancelling jobs. Specify request/response formats, status codes, and error handling.
Describe how to run user code securely: use containers or microVMs, enforce resource limits (CPU, memory, time), and manage dependencies. Discuss class loading and isolation.
Explain how to manage concurrent executions, queueing, and scaling. Describe mechanisms for streaming logs and results in real-time, such as WebSockets or SSE.
Discuss trade-offs between isolation levels, performance, and cost. Cover monitoring, logging, failure recovery, and how to handle dependency conflicts.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.