Loading portfolio
Prem Sai KotaSoftware Engineer
Projects
2 / 11
2026·Dsa practice arena·View Website

Mahayuddh

A social practice platform built around LeetCode problem solving, pairing daily timed battles with squad accountability, approach write-ups, and verified progress.

Next.js
TypeScript
Supabase
PostgreSQL
Tailwind CSS
LeetCode GraphQL
Google Gemini

Moving Beyond Lonely LeetCode

Grinding data structures and algorithms is usually a solitary and demotivating exercise. Developers copy and paste solutions to protect streaks, scroll through disorganized community roadmaps, or abandon problems entirely when stuck without targeted help. I wanted to build a social practice layer around LeetCode that avoided judging code directly, but instead captured genuine daily effort, shared problem-solving approaches, and kept a developer squad accountable to each other. Mahayuddh was built around a continuous cycle: learn, battle, prove, explain, and compare. Instead of competing on vanity points, developers commit to a single daily challenge, solve it under real-time constraints, and discuss mental models with their peers.

The Rule of Honest Verification

Building another code judge was pointless when LeetCode already does it well. Instead, I connected Mahayuddh directly to LeetCode's unofficial GraphQL API. I established two foundational principles: never gate participation on a connected LeetCode handle, and never present unverified data as genuine. The system supports two verification workflows. Public profiles poll recent accepted submissions, while private profiles authenticate through session cookies. Most importantly, self-reported solves look visually distinct from submission-verified records across the entire UI. If a timestamp, runtime, or rank delta cannot be proven from server evidence, the interface explicitly notes the distinction.

Structuring Event-Driven Battling

Rather than mutating status flags in place, I modeled Mahayuddh around an append-only event stream in PostgreSQL 17 on Supabase. A developer's current state is derived from chronological events across battles, problem events, and user problem status records. When a user begins a battle, the floating dock initializes a monotonic timer that survives browser reloads and network interruptions. I wrote Row Level Security policies across every table, establishing strict boundaries between private notebook notes, squad-visible feeds, and public proof pages. Client applications cannot insert arbitrary records into rate limits, analytics, or notification tables, keeping state transitions strictly guarded.

Capping the AI Hint Ladder

When practicing DSA, standard AI assistants often ruin the learning curve by dumping the full optimal algorithm at the first sign of struggle. I built a tiered stuck ladder backed by Google Gemini over an OpenAI-compatible wire to deliver progressive assistance. The ladder has four levels — a nudge, the pattern, a direction, and finally a full walkthrough — and even the last level never hands over a finished solution: code blocks are stripped from the model output on the server. Each tier has strict output token clamps enforced by server validation, and database triggers prevent budget exhaustion. The assistant guides the developer's intuition without depriving them of the breakthrough moment.

The Obsidian Pass Design System

I avoided generic dashboard component kits and designed a focused aesthetic called the Obsidian-Gold system. The visual hierarchy relies on an obsidian canvas, hairline borders, warm gold action accents, and emerald indicators for verified proof. The core visual artifact is the Pass—a tactile card layout featuring a primary body and a perforated stub. Daily battles, 1v1 challenges, and completed problem proofs are all rendered as Passes. When a battle finishes, Mahayuddh generates shareable Proof cards formatted for social sharing, displaying verified solve times, pattern badges, and algorithmic complexity notes without visual clutter.

What Mahayuddh Taught Me

Mahayuddh taught me that a product's integrity depends entirely on the honesty of its underlying data model. In social and competitive platforms, even minor optimistic UI updates or race conditions destroy user trust instantly. To ensure resilience, I implemented automated testing suites covering 240 smoke tests and 84 security abuse cases before shipping, asserting protections against request forgery, enumeration, and timezone drifts in streak calculations. Building Mahayuddh showed me how to design strict boundary contracts and enforce security controls directly inside database migrations and API gateways.