Inspiration Every CS student knows the feeling — you submit your code for review, and someone tears it apart. We thought, what if we took that anxiety and turned it up to 11? Inspired by the intense, high-stakes technical interviews at FAANG companies and the absurdity of internet "brainrot" culture, we built an AI interviewer that doesn't just review your code — it roasts you in real-time, using the exact vocabulary that lives rent-free in every CS student's head. Think a toxic 10x senior engineer who calls your O(n²) solution "skibidi" and questions your aura for using single-letter variable names.
What it does gradientDescent is a real-time AI-powered mock technical interviewer that watches you code and listens to you explain your solution — then ruthlessly roasts both. You type Python code in a Monaco editor while the AI avatar watches from a laptop screen on the right side. The moment you pause typing or speak into your mic, the AI fires back with a punchy, comedic roast about your specific code mistakes, bad variable names, and questionable time complexity — all delivered in spoken audio with brainrot lingo like "sigma," "no cap," and "Ohio." It even shows your webcam in a picture-in-picture overlay so you can watch your own face as you get roasted.
How we built it Frontend: React + Vite with a split-screen layout — Monaco code editor on the left, a 3D-perspective laptop avatar on the right with animated keyboard backlight that changes color based on state (idle → judging → roasting). The webcam preview uses a minimizable PiP overlay. Backend: Node.js + Express server with a WebSocket layer for real-time bidirectional communication. AI Pipeline: We use the Gemini Live API (gemini-2.5-flash-native-audio-preview) for real-time conversational audio. Microphone audio is captured at 48kHz, downsampled to 16kHz PCM, base64-encoded, and streamed to Gemini via WebSocket. Gemini processes both the audio and the code context, then streams back 24kHz PCM audio responses that we schedule for gapless playback using the Web Audio API. Legacy fallback: We also built a REST endpoint using Gemini for text generation + ElevenLabs for TTS as a backup. Challenges we ran into Audio state management was our biggest headache. React's re-rendering lifecycle kept tearing down and rebuilding the microphone AudioContext on every state change, killing the audio pipeline after the AI's first response. We solved this using a ref-based callback pattern to decouple the audio stream lifecycle from React's render cycle. Turn detection: After the AI finished roasting, the app wouldn't respond to new input. We had to wire up Gemini's turnComplete signal through the entire WebSocket pipeline (backend → protocol → frontend) to properly reset the UI state and re-enable input. Audio playback scheduling: Gemini streams audio in small PCM chunks. We had to implement a precise scheduling system using AudioContext.currentTime to play them back-to-back without gaps or overlap, with underrun detection to recover gracefully. Accomplishments that we're proud of True real-time roasting — the AI listens, watches your code, and responds conversationally in real-time, not just on button click. It feels like a real (terrible) interviewer. Seamless audio pipeline — mic capture → downsampling → WebSocket → Gemini → audio response → gapless playback, all working in the browser with sub-second latency. The comedy actually lands — the system prompt engineering produces genuinely funny, specific roasts that reference your actual code mistakes rather than generic insults. Interruption handling — if you talk over the AI, it detects the interruption, stops speaking, and listens to your new input. What we learned The Gemini Live API is incredibly powerful for building conversational AI experiences, but managing the bidirectional audio pipeline in-browser requires careful attention to Web Audio API quirks, sample rate conversions, and React lifecycle management. Audio programming in the browser is fundamentally different from typical web dev — you're working with Float32Arrays, ScriptProcessorNodes, and precise timing, where a bug doesn't show an error message, it just sounds wrong. Parallel development with a clear API contract (defined in our design doc upfront) let the backend and frontend teams build independently and integrate smoothly.
Log in or sign up for Devpost to join the conversation.