This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
I built MockMate, a voice-powered mock interview partner designed for a close friend who gets severe interview anxiety during technical and behavioral rounds. It simulates a live hiring manager, reads interview questions out loud using natural voice synthesis, and guides them through a realistic conversational feedback loop to help them practice speaking their answers aloud.
st.audio).
Open-source frameworks and open APIs allow developers to completely decouple user interfaces from proprietary vendors. For an application handling sensitive career data like targeted job descriptions, past employment backgrounds, and vulnerable mock interview answers, utilizing flexible cloud runtimes and open modular tooling ensures that developers retain full control over data pathways, audio pipelines, and model customizations without vendor lock-in.
python
import os
import streamlit as st
import requests
st.set_page_config(page_title="MockMate - AI Interview Partner", page_icon="🎙️", layout="centered")
st.title("🎙️ MockMate")
st.caption("Your personal, voice-powered AI interview coach. Built for a friend.")
with st.sidebar:
st.header("Configuration")
target_role = st.text_input("Target Role", "Frontend Developer")
job_desc = st.text_area("Paste Job Description", "Looking for a React developer with 3+ years experience...")
elevenlabs_api_key = st.text_input("ElevenLabs API Key", type="password")
voice_id = st.text_input("ElevenLabs Voice ID", "21m00Tcm4TlvDq8ikWAM") # Default Rachel voice
if "messages" not in st.session_state:
st.session_state.messages = []
def text_to_speech(text, api_key, voice_id):
url = f"[https://api.elevenlabs.io/v1/text-to-speech/](https://api.elevenlabs.io/v1/text-to-speech/){voice_id}"
headers = {
"Accept": "audio/mpeg",
"Content-Type": "application/json",
"xi-api-key": api_key
}
data = {
"text": text,
"model_id": "eleven_monolingual_v1",
"voice_settings": {"stability": 0.5, "similarity_boost": 0.5}
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
return response.content
return None
if not st.session_state.messages:
if st.button("Start Mock Interview"):
initial_question = f"Hello! Let's start your mock interview for the {target_role} position. To kick things off, can you tell me about yourself and your relevant experience?"
st.session_state.messages.append({"role": "assistant", "content": initial_question})
st.rerun()
for message in st.session_state.messages:
with st.chat_message(message["role"]):
st.write(message["content"])
if message["role"] == "assistant" and elevenlabs_api_key:
audio_bytes = text_to_speech(message["content"], elevenlabs_api_key, voice_id)
if audio_bytes:
st.audio(audio_bytes, format="audio/mp3")
user_input = st.chat_input("Type your answer here...")
if user_input:
st.session_state.messages.append({"role": "user", "content": user_input})
with st.chat_message("user"):
st.write(user_input)
next_question = f"Thank you for that answer. Based on the job description for {target_role}, how do you handle debugging complex performance issues under a tight deadline?"
st.session_state.messages.append({"role": "assistant", "content": next_question})
with st.chat_message("assistant"):
st.write(next_question)
if elevenlabs_api_key:
audio_bytes = text_to_speech(next_question, elevenlabs_api_key, voice_id)
if audio_bytes:
st.audio(audio_bytes, format="audio/mp3")
st.rerun()