LinkedInGithubInstagram

Code Execution

ReactMonacoPiston APISocketRedisAWS
Screenshot 1
Screenshot 2
Screenshot 3

Problem

Students preparing for Data Structures and Algorithms (DSA) had no way to write or run code within our LMS. Existing quizzes were limited to multiple-choice, making it hard to assess real coding ability or encourage hands-on learning.

Solution

I architected a custom code execution layer by embedding the Monaco Editor directly inside our LMS, integrated with the Piston API for backend execution. This allowed students to write, run, and debug code in real time across multiple programming languages.

The backend was hosted on AWS EC2, secured behind an Application Load Balancer, and optimized for high availability. Code execution requests were processed asynchronously using Redis-backed Sidekiq workers, enabling us to handle millions of concurrent test runs without bottlenecks.

For live classroom use cases, we implemented WebSocket rooms for real-time collaboration between teachers and students. Each session was isolated using dynamic room IDs, ensuring low-latency and secure communication at scale.

This infrastructure allowed us to move beyond static quizzes and provide a production-grade, scalable coding platform inside our LMS — built for real-world readiness.

© Keshav Raj, Let's Code