AWS Builder Center

CodeCoach AI: Turning Codeforces History into a Personal Competitive Programming Coach

What if your Codeforces history could tell you not just how you are performing, but what you should learn next? CodeCoach AI analyzes your problem-solving patterns and uses Amazon Bedrock to provide personalized insights, recommendations, and AI-powered code feedback.

Competitive programming platforms are great at telling us what we solved. They are much less helpful at telling us why we are getting stuck.
That was the problem we wanted to solve while building CodeCoach AI.
A student can have hundreds of solved Codeforces problems, a visible rating, and a long submission history, but still not know which algorithmic patterns are holding them back. We wanted to build something that could look at that history, identify useful patterns, and turn them into a practical learning plan.
So instead of building another dashboard that says “you solved 200 problems,” we built a coach that asks:
What are you struggling with, why might you be struggling, and what should you practice next?

What we built

CodeCoach AI is a web application for competitive programmers. A user enters their Codeforces username and the application pulls their submission history and profile information through the Codeforces API.
From that data, the backend calculates statistics such as:
  • problems attempted and solved
  • acceptance rate
  • performance across rating ranges
  • success rate by problem topic
  • average rating of solved problems for each topic
  • topics where the user appears strong, developing, or in need of practice
The important part is that we do not stop at statistics.
The dashboard turns those numbers into three practical features:

1. Why Am I Stuck?

This is the part of the project that we found most interesting.
Instead of sending a user's entire submission history to an AI model, we first process the data ourselves. We calculate rating-wise and topic-wise performance, identify weak and strong areas, and then give the summarized results to the AI.
The AI then interprets the pattern and gives feedback such as:
  • where the user's success rate starts dropping
  • which topics appear to be bottlenecks
  • possible algorithmic reasons for the bottleneck
  • what the user should focus on next
This approach also makes the AI response more grounded because the model is working from statistics calculated by our application instead of inventing them.

2. Personalized Practice Roadmap

Once weak areas are identified, CodeCoach AI turns them into a four-week practice plan.
For example, if a user consistently struggles with a particular topic, the roadmap can prioritize that topic and suggest a small sequence of practice tasks rather than simply telling the user to “practice more.”

3. AI Code Coach

This is where Amazon Bedrock becomes the core of the experience.
A user can provide a Codeforces problem and their solution. Our backend sends the problem context, constraints, tags, rating, programming language, and code to Amazon Bedrock.
The model then reviews the solution and returns structured feedback covering:
  • the algorithm used
  • time complexity
  • space complexity
  • possible correctness concerns
  • performance issues
  • code quality issues
  • a better approach when one exists
  • why the alternative is better
  • patterns the user should learn
  • actionable recommendations
We deliberately added instructions to avoid common but misleading advice. For example, the model is told not to automatically recommend recursion or claim that “fewer variables” always means better code. It has to consider the actual problem constraints and explain why an optimization matters.

Where Amazon Bedrock fits

Amazon Bedrock is the AI layer of CodeCoach AI.
Our Node.js backend uses the AWS SDK for JavaScript to call the Bedrock runtime. We keep the AI call on the server side so that the frontend never needs direct access to AWS credentials.
The basic flow for code analysis looks like this:
User enters code
↓
React / Vite frontend
↓
Node.js + Express backend
↓
Build structured prompt
↓
Amazon Bedrock
↓
Structured JSON response
↓
React dashboard
For the “Why Am I Stuck?” feature, the flow is slightly different:
Codeforces submission history
↓
Our analysis service
↓
Rating + topic statistics
↓
Summarized performance data
↓
Amazon Bedrock
↓
Bottleneck + evidence + recommendations
Using the AI only after the application has done the initial data processing was an important design choice for us. It gave us more control over what information the model sees and made it easier to keep the explanations tied to actual user data.
Amazon Bedrock also fits the project well because model inference is available through a managed API instead of us having to run and maintain our own model-serving infrastructure.

Keeping AI usage under control

One of the practical lessons we learned was that AI calls should not happen just because they can.
We added caching at two levels.
For Codeforces data, frequently requested profile and submission responses are cached for a short period. This reduces repeated external API calls while a user explores the dashboard.
For AI features, we cache “Why Am I Stuck?” results for a period of time and also hash the problem, programming language, and source code for code-analysis requests. When exactly the same analysis is requested again, the backend can return the cached result instead of calling Bedrock again.
That gives us two benefits: faster responses and lower unnecessary model usage.

The architecture

The project is intentionally simple enough to understand end-to-end:
CodeCoach AI
│
┌──────────┴──────────┐
│ │
React + Vite Node.js + Express
│ │
│ ┌─────┴─────┐
│ │ │
│ Codeforces API Amazon Bedrock
│
└──────── HTTPS API ───────┘
For cloud deployment, the application is structured so the React frontend can be hosted with AWS Amplify and the Node.js backend can run on AWS App Runner. App Runner provides a managed way to build and run Node.js web applications from source code, while Amplify Hosting provides managed hosting and continuous deployment for web applications.

Why we used Kiro while building it

We also used Kiro during development.
One thing we liked about Kiro was that it could work with the whole project instead of treating every prompt like an isolated coding question. We used it to help understand the existing codebase, work through implementation steps, debug issues, and iterate across the React frontend and Node.js backend.
That was particularly useful for a hackathon project because the application had several moving parts: Codeforces data handling, statistics, recommendations, the Bedrock integration, frontend state, and caching.
Kiro's structured, agentic development workflow helped us move faster while still reviewing and testing the changes ourselves.

One of the most important lessons we learned

We initially thought the interesting part of the project would be “AI reviewing competitive programming code.”
During development, we realized that the bigger challenge is actually giving the AI the right context.
A generic prompt such as:
Review this code and tell me how to improve it.
does not provide enough information.
The same code can be perfectly reasonable for one set of constraints and completely unsuitable for another.
So our prompt includes the problem statement, constraints, tags, rating, language, and the user's code. We also explicitly tell the model to consider whether the current solution is already optimal for the constraints.
That changed the quality of the feedback significantly.
The second lesson was that not everything needs to be AI.
The calculations for success rate, rating distribution, topic attempts, and weakness detection are deterministic backend logic. We use AI where interpretation and personalized explanation add value.
That split makes the system easier to reason about and gives us more predictable results.

What we would like to build next

There are several directions we would like to explore:
Solution comparison: compare a user's approach with a reference approach and explain the conceptual difference without simply copying another user's submission.
Progress tracking: remember which recommended problems were completed and update the roadmap based on progress.
Trend analysis: show how a user's strengths and weaknesses change over time rather than only analyzing the current snapshot.
Better recommendations: combine topic weakness, rating range, previous attempts, and recent activity to make problem recommendations more precise.
More languages: improve code analysis across C++, Java, Python and other commonly used competitive programming languages.

Final thoughts

CodeCoach AI started with a simple question:
What if your competitive programming dashboard could actually coach you?
Our goal is not to replace editorials, teachers, or the competitive programming community. It is to make a user's own submission history more useful.
Instead of just saying:
“You solved 300 problems.”
we want the system to say:
“Here is where your performance starts dropping, here is the evidence, here is what may be causing it, and here is what you can practice next.”
That is the direction we are taking CodeCoach AI, and building it with Amazon Bedrock and Kiro gave us a practical way to turn that idea into a working prototype.



Tech stack

Frontend: React, Vite, Recharts, Monaco Editor Backend: Node.js, Express Data: Codeforces API AI: Amazon Bedrock Development: Kiro Deployment-ready: AWS Amplify Hosting + AWS App Runner

Project links

We'd love to hear from other competitive programmers

What is the hardest part of improving on Codeforces for you: choosing the right algorithm, debugging, recognizing patterns, or knowing what to practice next?
Let us know — that feedback is exactly what we want to use to improve CodeCoach AI and yes we are working on its deployment and soon update it when project comes live.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article