<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Max Rymash on Medium]]></title>
        <description><![CDATA[Stories by Max Rymash on Medium]]></description>
        <link>https://medium.com/@maxforsamp98?source=rss-c5af8fa0968e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Hm-_FQrg9Cv1SjxI</url>
            <title>Stories by Max Rymash on Medium</title>
            <link>https://medium.com/@maxforsamp98?source=rss-c5af8fa0968e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 17:13:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@maxforsamp98/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building an AI Interviewer Agent with Google Gemini and LangGraph]]></title>
            <link>https://medium.com/@maxforsamp98/building-an-ai-interviewer-agent-with-google-gemini-and-langgraph-c752e0ae65f3?source=rss-c5af8fa0968e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c752e0ae65f3</guid>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[langchain]]></category>
            <dc:creator><![CDATA[Max Rymash]]></dc:creator>
            <pubDate>Sat, 19 Apr 2025 21:03:38 GMT</pubDate>
            <atom:updated>2025-04-20T15:40:11.858Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>Let&#39;s be honest: preparing for tech interviews can be tough. You grind LeetCode, watch mock interviews on YouTube, but something&#39;s often missing. If you&#39;re like me, maybe you don&#39;t have tech buddies available 24/7 for practice, or you worry if the feedback you <em>do</em> get is actually helpful. Solving problems on your own is one thing, but explaining your thought process under pressure? That&#39;s a whole different skill.</p><p>This exact feeling sparked an idea for my Google GenAI Capstone project: <strong>What if AI could be that reliable, on-demand practice partner?</strong> An AI that doesn&#39;t just throw questions at you, but actually interviews you, guides you when you&#39;re stuck, and gives detailed feedback?</p><p>So, I built one! It&#39;s an <strong>AI Mock Technical Interviewer</strong>, created using Google&#39;s powerful Gemini AI model and a cool framework called LangGraph.</p><figure><img alt="AI Mock Interviewer App UI" src="https://cdn-images-1.medium.com/max/1024/1*suswojRtydmPdBhf2oSvyg.png" /><figcaption>AI Mock Interviewer UI</figcaption></figure><p>In this post, I&#39;ll share:</p><ul><li><strong>The &quot;Why&quot;:</strong> The problem I wanted to solve (based on my own prep!).</li><li><strong>The &quot;What&quot;:</strong> What my AI interviewer actually does.</li><li><strong>The &quot;How&quot;:</strong> The tools I used (Gemini, LangGraph, etc.) and why.</li><li><strong>Behind the Scenes:</strong> Some key moments, challenges, and code snippets from the build.</li><li><strong>What&#39;s Next:</strong> Where I see this project going.</li></ul><h3>The Problem: Difficulties in Self-Led Interview Training</h3><p>Like many developers, I&#39;m currently preparing for technical interviews. I quickly realized that just solving coding problems isn&#39;t enough. Real interviews involve:</p><ul><li><strong>Talking through your logic: </strong>Explaining <em>why</em> you chose a certain approach.</li><li><strong>Asking clarifying questions:</strong> Making sure you understand the problem.</li><li><strong>Handling hints: </strong>Getting unstuck gracefully.</li><li><strong>Getting feedback:</strong> Understanding your strengths and weaknesses.</li></ul><p>Finding someone who has the time, expertise, and willingness to conduct realistic mock interviews and provide solid feedback is hard! This is where the idea for an AI interviewer really took shape.</p><h3>The Solution: An AI Practice Partner</h3><figure><img alt="AI Mock Technical Interviewer logo" src="https://cdn-images-1.medium.com/max/1024/1*KOCF7Hv2SMBjRv9uemJddA.jpeg" /><figcaption>AI Mock Technical Interviewer logo</figcaption></figure><p>My goal was to create an AI that feels less like a static quiz and more like a helpful interviewer. Here’s what it does:</p><p>1. <strong>Conducts the Interview:</strong> It asks coding questions (from a predefined list, no random stuff!).</p><p>2. <strong>Guides and Hints:</strong> If you get stuck, it can offer subtle hints, just like a real interviewer might.</p><p>3. <strong>Understands Whiteboarding:</strong> You can <em>draw</em> your ideas on a digital whiteboard (using Gradio&#39;s Sketchpad), and the AI uses Gemini&#39;s image understanding to &quot;see&quot; and discuss your drawing!</p><p>4. <strong>Listens and Remembers:</strong> Using LangGraph, the AI keeps track of the conversation, so it understands the context.</p><p>5. <strong>Gives Detailed Feedback:</strong> After you finish, it analyzes the entire conversation and your code to provide a structured report on your technical skills, problem-solving approach, and communication.</p><p>6. <strong>Creates a Learning Plan:</strong> It even identifies areas you need to work on and uses Google Search (via Gemini Grounding) to suggest relevant learning resources!</p><p>All of this is powered by Google&#39;s Gemini AI models, which handle the talking, understanding text and images, structuring the feedback, and even searching the web for relevant study materials.</p><h3>The Toolkit: Why I Chose These Tools</h3><figure><img alt="Toolkit logos: Kaggle, LangGraph, Gemini, Langchain, Gradio" src="https://cdn-images-1.medium.com/max/1024/1*7oB64j8XANIJzUQEBohEsQ.png" /><figcaption>Tools used to build the app</figcaption></figure><p>I got introduced to these tools during a Google GenAI course, and they felt like a great fit for this project:</p><ul><li><strong>Google Gemini:</strong> This is the AI &quot;brain.&quot; It&#39;s great at understanding natural language, looking at images (the whiteboard feature!), generating human-like text, following complex instructions (like giving specific feedback), and using other tools (like function calling and search).</li><li><strong>LangGraph:</strong> Think of this as the &quot;director&quot; of the interview. An interview has steps: start, ask a question, get the answer, give a hint (maybe), end, and evaluate. LangGraph lets you define this flow clearly, managing the conversation state step-by-step.</li><li><strong>LangChain:</strong> Provides helpful building blocks for working with AI models and tools, making it easier to connect everything.</li><li><strong>Gradio:</strong> This made creating the interactive web interface surprisingly easy. It provides ready-made components for text chat, a code editor, and even a sketchpad/whiteboard.</li><li><strong>Kaggle Notebooks:</strong> This project was built for the Google course, which required using Kaggle. It turned out to be a convenient place to code, manage secrets (like the API key), and share the project.</li></ul><h3>Building It: Highs, Lows, and Code Snippets</h3><p>Creating this involved a lot of trial and error, but also some really cool moments:</p><p><strong>Challenge &amp; &quot;Aha!&quot; Moment #1: Teaching the AI to Interview</strong></p><p>Getting the AI to behave like a <em>good</em> interviewer took the most effort. I wrote a long initial prompt telling it how to act (be supportive, give hints, ask probing questions). But you can&#39;t predict every situation!</p><p>I&#39;d test it, and the AI would do something unexpected – maybe give a hint too quickly, or misunderstand the whiteboard. Each time, I&#39;d go back and tweak the prompt, adding more specific instructions or examples (this is called few-shot learning). It was a constant back-and-forth, but each improvement felt like a mini-victory, teaching the AI a bit more about the nuances of interviewing.</p><p><strong>Challenge &amp; &quot;Aha!&quot; Moment #2: Tools That Change Things</strong></p><p>LangGraph makes it easy for the AI to use &quot;tools&quot; – functions that fetch data or perform actions. Most tools just return information, like listing available questions. But I needed tools that actually <em>changed</em> the interview <strong>state</strong>. Think of the &quot;state&quot; as the interview&#39;s memory – it holds the conversation history, the current question, the code you&#39;ve written, and whether the interview has finished.</p><p>Here is a visualization of the Interview Flow with LangGraph</p><figure><img alt="Interview Graph structure" src="https://cdn-images-1.medium.com/max/1024/1*J-AXInF3P8espF9NViqYLw.png" /><figcaption>Interview Flow with LangGraph</figcaption></figure><p>This required a special setup in LangGraph. The select_question tool itself is simple (it just defines <em>that</em> the action exists):</p><pre># Tool definition for selecting a question<br><br>class SelectQuestionArgs(BaseModel):<br>    &quot;&quot;&quot;Input schema for the select_question tool.&quot;&quot;&quot;<br>    ID: Literal[tuple(IDS)] = Field(description=&quot;ID of the question&quot;)<br><br>@tool(args_schema=SelectQuestionArgs)<br>def select_question(ID: str) -&gt; str:<br>    &quot;&quot;&quot;Shows user question with provided ID.<br>    ALWAYS use this tool when the candidate confirms selected question.<br>    You can start interview process ONLY after using this tool.<br>    &quot;&quot;&quot;<br>    # This tool itself doesn&#39;t contain the main logic...<br>    pass # ...the logic happens in the custom node below</pre><p>The <em>real</em> work happens in a custom LangGraph <em>node</em> called question_selection_node. This node runs <em>after </em>the AI decides to use the select_question tool:</p><pre># Simplified logic inside the &#39;question_selection_node&#39; function<br><br>def question_selection_node(state: InterviewState) -&gt; InterviewState:<br>    # 1. Get the last AI message (which contains the tool call)<br>    tool_msg: AIMessage = state.get(&quot;messages&quot;, [])[-1]<br><br>    # 2. Loop through tool calls in that message (usually just one here)<br>    for tool_call in tool_msg.tool_calls:<br>        if tool_call[&quot;name&quot;] == &quot;select_question&quot;:<br>            # 3. Extract the Question ID the AI provided<br>            ID: int = int(tool_call[&quot;args&quot;][&quot;ID&quot;])<br><br>            # 4. Find the question details in the question database <br>            selected_question: pd.Series = df[df.id==ID].iloc[0]<br>            question_content = selected_question.content<br>            question_code = selected_question.code<br><br>            # 5. Prepare a message confirming the selection<br>            response = f&quot;Okay, let&#39;s work on &#39;{selected_question.problem_name}&#39;. Here&#39;s the description:\n{question_content}\nInitial code:\n{question_code}&quot;<br><br>            # Create a message containing the response for the AI<br>            tool_message = ToolMessage(content=response, name=tool_call[&quot;name&quot;], tool_call_id=tool_call[&quot;id&quot;])<br><br>    # 6. CRITICAL STEP: Update the state dictionary with the new question and code!<br>    # The &#39;|&#39; merges the old state with the new values.<br>    return state | {<br>        &quot;messages&quot;: [tool_message], # Add the tool result message<br>        &quot;question&quot;: question_content, # Update the active question<br>        &quot;code&quot;: question_code         # Update the starter code<br>    }</pre><p>Making these state-changing tools work correctly felt like properly wiring up the AI&#39;s brain and hands – tricky, but essential!</p><p><strong>Explaining LangGraph&#39;s Tool Magic (Simply):</strong></p><p>LangGraph provides powerful ways to structure AI interactions, but some of its abstractions, like how tools are called, can be a bit confusing at first glance, requiring a deeper dive into its underlying implementation.</p><p>Here&#39;s the simple version of how the <em>standard</em> ToolNode (used for tools that <em>don&#39;t</em> change the state directly, like getting the list of topics) works:</p><ol><li>You chat with the AI interviewer.</li><li>Based on the conversation and its instructions (especially after using .bind_tools(tools) to tell the model which tools are available), the AI (Gemini) might decide it needs to use a tool. It outputs a special AIMessage containing tool_calls, like: AIMessage(content=&quot;&quot;, tool_calls=[{&quot;name&quot;: &quot;get_topic_categories&quot;, &quot;args&quot;: {}, &quot;id&quot;: &quot;call_123&quot;}]).</li><li>LangGraph routes the flow to the ToolNode.</li><li>ToolNode looks at the tool_calls in that last AIMessage.</li><li>It finds the matching Python function (e.g., our get_topic_categories function decorated with @tool).</li><li>It runs that function.</li><li>It takes the result (the list of topics) and wraps it in a ToolMessage, linking it back to the original call ID: ToolMessage(content=[&#39;Arrays&#39;, &#39;Linked Lists&#39;, ...], name=&#39;get_topic_categories&#39;, tool_call_id=&#39;call_123&#39;).</li><li>This ToolMessage gets added to the state&#39;s message list.</li><li>The flow usually goes back to the AI, which now sees the tool result and can form its next response, like, &quot;Okay, we have questions on these topics: Arrays, Linked Lists...&quot;</li></ol><p>For tools like select_question that <em>do</em> need to change the state, we bypass the standard ToolNode and use a custom node (question_selection_node) as shown in the previous section.</p><p><strong>Surprise! The AI Gives Good Feedback?</strong></p><p>I was genuinely impressed by the quality of the feedback the AI generated. It didn&#39;t just say &quot;good job&quot; or &quot;try harder.&quot; It pointed to specific parts of the conversation, analyzed my approach, commented on communication, and created that personalized learning plan. It highlighted things I wouldn&#39;t notice just by solving problems alone. That showed me the real value beyond just question-answering.</p><p>It also surprised me with its flexibility. I could ask &quot;give me beginner array problems&quot; and it would understand and use the list_questions tool with the right filters (difficulty=&#39;Easy&#39;, category=&#39;Array Manipulation&#39;). Switching questions mid-interview was also smooth, thanks to the state management and tools.</p><p><strong>Getting the Structured Feedback:</strong></p><p>To make sure the final report was consistent and easy to use, I told Gemini exactly what format to use. I defined a structure using Python&#39;s Pydantic library, like a blueprint for the report.</p><pre># Example Pydantic Model (Blueprint for part of the feedback)<br>class StrengthItem(BaseModel):<br>    &quot;&quot;&quot;Represents a single observed strength.&quot;&quot;&quot;<br>    point: str = Field(..., description=&quot;Concise statement of the strength&quot;)<br>    evidence: str = Field(..., description=&quot;Specific examples or quotes&quot;)<br><br>class EvaluationOutput(BaseModel):<br>    &quot;&quot;&quot;Root object for the complete evaluation.&quot;&quot;&quot;<br>    overall_summary: str = Field(..., alias=&quot;overallSummary&quot;)<br>    strengths: List[StrengthItem] = Field(...)<br>    # ... other fields like areas_for_development, detailed_analysis, etc.</pre><p>Then, when calling the Gemini API to generate the report, I told it to follow this blueprint:</p><pre># Inside the function that generates the report (create_report_node)<br><br>evaluation_response = client.models.generate_content(<br>    model=&#39;gemini-2.0-flash&#39;,<br>    contents=CANDIDATE_EVALUATION_PROMPT.format(...), # Prompt asking for evaluation<br>    config={<br>        &#39;response_mime_type&#39;: &#39;application/json&#39;, # Tell it we want JSON<br>        &#39;response_schema&#39;: EvaluationOutput,     # Tell it the *exact* structure/blueprint<br>    },<br>)<br># Now, evaluation_response.parsed contains the data neatly structured<br>evaluation_data: EvaluationOutput = evaluation_response.parsed</pre><p>This ensures the output is always organized the same way, making it reliable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KUbJbPFxEab6h1ZVUHNc_g.png" /><figcaption><em>Example of the part of the candidate_report.md</em></figcaption></figure><h3>Limitations and What&#39;s Next</h3><p>This is a great start, but it&#39;s not perfect:</p><ul><li><strong>It Can&#39;t <em>Run</em> Your Code:</strong> The AI analyzes the code you type as text, but it doesn&#39;t actually execute it to check for errors or test edge cases.</li><li><strong>Human Nuance:</strong> While the AI provides remarkably detailed analysis based on the transcript, it might not catch every subtle non-verbal cue or unspoken hesitation a human interviewer might notice. However, it offers a very strong and consistent approximation of a real evaluation process focused on what was said and coded.</li></ul><p><strong>My Next Steps:</strong></p><p>If I had more time, the top two things I’d add are:</p><ol><li><strong>Voice Interaction:</strong> Using speech-to-text and text-to-speech would make it feel much more like a real, immersive conversation. This is my #1 priority!</li><li><strong>Code Execution:</strong> Letting the AI actually run the code against test cases would provide even more valuable feedback.</li></ol><h3>Who Is This For?</h3><p>Honestly, I think anyone preparing for technical interviews could find this useful:</p><ul><li><strong>Beginners:</strong> Can get practice explaining their thoughts and benefit from the guided hints and personalized learning plans.</li><li><strong>Experienced Devs:</strong> Can refresh their knowledge and practice articulating complex solutions clearly.</li><li><strong>FAANG Aspirants:</strong> Can get targeted practice for the kind of algorithmic and problem-solving questions common in those interviews.</li></ul><h3>Final Thoughts</h3><p>I’m really proud of how this project turned out. It started as a personal need, wanting better interview practice, and grew into a functional tool that combines several cool AI technologies. Building the conversational flow with LangGraph, integrating the whiteboard feature with Gemini, and getting detailed, grounded feedback feels like a significant step towards making AI a genuinely helpful partner in interview preparation.</p><p><strong>Want to see it in action or peek at the code?</strong></p><p>You can find the complete project in my Kaggle Notebook:</p><p><a href="https://www.kaggle.com/code/maxymrim/mock-technical-interviewer-with-gemini-langgraph"><strong>&gt;&gt;&gt; Mock Technical Interviewer with Gemini &amp; LangGraph &lt;&lt;&lt;</strong></a></p><p>Check out the Project Breakdown + Demo video on YouTube:</p><p><a href="https://youtu.be/8ct_uJ772Zk"><strong>&gt;&gt;&gt; Building AI Interviewer Agent (Project Breakdown + Demo) &lt;&lt;&lt;</strong></a></p><p>Give it a try! I’d be thrilled to hear your feedback, suggestions, or ideas in the comments on Kaggle or below! What features would <em>you</em> find most helpful?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c752e0ae65f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>