BeatCode
Beat Your Own Code: Learn. Improve Optimise.
The problem BeatCode solves
LeetCode warriors, beatCode lets users input their solutions, receive intelligent hints, visualize optimizations, and ultimately improve their code step-by-step.
Challenges we ran into
One major hurdle was handling multi-language code input and execution. Users can submit solutions in Python, C++, or Java, and we needed a consistent way to process, validate, and optimize that code regardless of the language.
Problem:
Initially, using just the Gemini API caused issues because its responses varied by language — sometimes returning code that didn’t compile or didn’t align with the user’s original logic. Also, compiling code server-side securely was a concern.
Deployement was a big hurdle which we are still tackling.
Solution:
We integrated Judge0 API as a fallback to handle actual code compilation and output verification across languages. We also created dynamic prompt templates for Gemini that adapt based on the selected language and structure of the user’s code. This increased the reliability of optimizations.
This modular approach now lets us easily scale or swap APIs if needed.
Tracks Applied (2)
