Overview
The Mock Interview feature provides a realistic interview simulation experience by generating personalized questions based on resume content, supporting multi-round intelligent follow-up questions, and delivering detailed performance evaluations. All session state is managed via Redis cache with database persistence for recovery.Interview sessions are cached in Redis for fast access, with automatic fallback to database when cache expires.
Creating an Interview Session
Users can start a mock interview based on an analyzed resume:- Request Body
- Response
resumeText: Required, extracted text from resumeresumeId: Optional, links session to a specific resumequestionCount: Number of questions (default: 5)forceCreate: If false, returns existing unfinished session
Session Creation Flow
Check for Existing Session
If
forceCreate is false and resumeId is provided, the system checks for unfinished sessions:Generate Questions
The AI generates personalized questions based on resume content, avoiding previously asked questions:
Session Status Lifecycle
Interview sessions progress through four distinct states:Status Definitions
Status Definitions
Intelligent Question Generation
The system generates questions with optional follow-up questions:Main Questions
Core interview questions based on:
- Resume skills and experience
- Project descriptions
- Technical keywords
- Job level indicators
Follow-up Questions
Intelligent follow-ups that:
- Dive deeper into main topics
- Challenge assumptions
- Test practical knowledge
- Configurable count (default: 1)
Configuration
Follow-up questions are generated in sequence after the main question is answered, creating a natural interview flow.
Answering Questions
Get Current Question
Save Answer (Draft)
Save an answer without progressing to the next question:This allows users to save progress without committing. The
currentIndex remains unchanged.Submit Answer
Submit an answer and move to the next question:- Submission Flow
- Response
Check Completion
If this was the last question:
- Update status to COMPLETED
- Set evaluation status to PENDING
- Send evaluation task to Redis Stream
Early Submission
Users can submit the interview before answering all questions:- Updates status to COMPLETED
- Triggers asynchronous evaluation for answered questions
- Unanswered questions are scored as 0
Evaluation Process
Evaluation happens asynchronously after the interview is completed:Batch Evaluation Strategy
To avoid token limits, answers are evaluated in batches:
Why Batch Evaluation?
Why Batch Evaluation?
Large interviews (10+ questions) can exceed AI model token limits. The system:
- Divides answers into configurable batches (default: 8)
- Evaluates each batch independently
- Aggregates scores and feedback
- Generates a final summary report
Individual Answer Scoring
Each answer is scored on:
- Accuracy (0-40 points): Technical correctness
- Completeness (0-30 points): Coverage of key points
- Clarity (0-30 points): Communication effectiveness
Overall Report Generation
The system generates:
- Overall score: Weighted average of all answers
- Strengths: List of strong points across answers
- Improvements: Actionable suggestions for weak areas
- Reference answers: Model answers for each question
Evaluation Status Flow
Viewing Interview Reports
Retrieve the comprehensive evaluation report:- Response Structure
- Frontend Display
PDF Export
Generate a professional PDF report:PDF Report Contents
PDF Report Contents
The exported PDF includes:
-
Cover Page
- Session ID and timestamp
- Resume reference (if linked)
- Overall score
-
Executive Summary
- Overall feedback
- Key strengths
- Priority improvements
-
Detailed Evaluation
- Each question with:
- Question text and category
- User’s answer
- Score breakdown
- Detailed feedback
- Reference answer
- Each question with:
-
Performance Trends (if multiple sessions)
- Score progression
- Category strengths
Session Recovery
Sessions are automatically recovered from the database if Redis cache expires:Users experience seamless continuity even if Redis is restarted or cache expires.
Deleting Sessions
Remove an interview session and all associated data:- Session entity
- All answer records
- Cached data in Redis
Rate Limiting
Protection against abuse:- Session creation: 5 per time window
- Answer submission: 10 per time window (global)
Best Practices
Check for Unfinished Sessions
Before creating a new session, call
/sessions/unfinished/{resumeId} to resume existing sessions.Implement Auto-save
Use the PUT
/answers endpoint to periodically save drafts as users type.Poll Evaluation Status
After completion, poll every 3-5 seconds for evaluation completion:
Handle Long Evaluations
Evaluation can take 30-60 seconds for large interviews. Show progress indicators.
Error Handling
Session Not Found
Session Not Found
Error:
INTERVIEW_SESSION_NOT_FOUNDCauses:- Invalid session ID
- Session deleted
- Session expired (both Redis and DB)
Interview Already Completed
Interview Already Completed
Error:
INTERVIEW_ALREADY_COMPLETEDCause: Attempting to submit answers to a completed sessionSolution: View the report instead of trying to submit more answers.Evaluation Failed
Evaluation Failed
Error:
evaluateStatus = FAILEDCauses:- AI API timeout
- Token limit exceeded (despite batching)
- Invalid answer format
evaluateError field for details. Users can manually trigger re-evaluation (if endpoint exists).