Skip to main content

Overview

These endpoints power the adaptive interview system, generating personalized questions based on user mastery and evaluating responses in real-time.
All endpoints require JWT authentication via Authorization: Bearer <token> header.

Generate Interview Questions

curl -X POST https://api.yourapp.com/api/mock_interview/questions \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "job_description": "Senior Python Developer with ML experience",
    "question_count": 8,
    "variation_seed": "focus_on_scalability"
  }'
Generate tailored interview questions using Mistral AI and resume context.
job_description
string
required
Job description to match questions against
question_count
integer
default:"8"
Number of questions (3-15)
variation_seed
string
Optional seed for question variation
success
boolean
Request status
questions
array
Generated interview questions
question_count
integer
Total questions generated
{
  "success": true,
  "question_count": 8,
  "questions": [
    {
      "question": "Describe how you would architect a scalable ML pipeline for real-time predictions",
      "type": "technical"
    },
    {
      "question": "Tell me about a time when you optimized a slow Python application",
      "type": "behavioral"
    },
    {
      "question": "Walk me through your experience with distributed systems",
      "type": "project-based"
    }
  ]
}

Evaluate Interview Answer

curl -X POST https://api.yourapp.com/api/mock_interview/evaluate_answer \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "question": {
      "question": "Explain the difference between REST and GraphQL",
      "type": "technical"
    },
    "answer": "REST uses multiple endpoints while GraphQL uses a single endpoint...",
    "job_description": "Backend Engineer role"
  }'
Evaluate a user’s interview answer using AI and resume context.
question
object
required
Question object with question and type fields
answer
string
required
User’s answer text
job_description
string
Job description for context
success
boolean
Request status
evaluation
object
Detailed answer evaluation
{
  "success": true,
  "evaluation": {
    "score": 85,
    "grade": "A",
    "strengths": "Clear comparison of REST and GraphQL, mentioned key differences like endpoint structure and data fetching",
    "improvements": "Could expand on use cases and performance trade-offs",
    "ideal_answer": "REST uses multiple endpoints for different resources, while GraphQL provides a single endpoint..."
  }
}

Get Interview History

curl -X GET https://api.yourapp.com/api/user/history \
  -H "Authorization: Bearer <token>"
Retrieve user’s complete interview history across all session types.
success
boolean
Request status
sessions
array
Interview session records
{
  "success": true,
  "sessions": [
    {
      "id": 42,
      "session_type": "agentic",
      "score": 78.5,
      "duration": 1245,
      "created_at": "2026-03-03T14:30:00Z",
      "questions": {
        "questions": [{"question": "Explain SOLID principles"}],
        "answers": {"0": "SOLID is an acronym..."}
      },
      "speech_metrics": {
        "wpm": 145,
        "fluency_score": 0.82,
        "speaking_ratio": 0.65
      }
    }
  ]
}

RAG Query

curl -X POST https://api.yourapp.com/api/query \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What is a binary search tree?",
    "top_k": 5
  }'
Query the knowledge base using RAG (Retrieval-Augmented Generation).
query
string
required
Question or search query
top_k
integer
default:"5"
Number of results to retrieve
success
boolean
Request status
answer
string
Generated answer from knowledge base
sources
array
Source documents used for answer
{
  "success": true,
  "answer": "A binary search tree (BST) is a node-based data structure where each node has at most two children...",
  "sources": [
    {"text": "BST definition...", "_score": 0.92},
    {"text": "BST operations...", "_score": 0.87}
  ]
}

Generate Coding Questions

curl -X POST https://api.yourapp.com/api/coding/questions \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "question_count": 3,
    "difficulty": "medium"
  }'
Generate SQL or Pandas coding challenges.
question_count
integer
default:"3"
Number of coding questions
difficulty
string
default:"medium"
Difficulty: easy, medium, or hard
success
boolean
Request status
questions
array
Generated coding challenges
{
  "success": true,
  "questions": [
    {
      "id": 1,
      "question": "Write a SQL query to find the top 5 customers by total purchase amount",
      "language": "sql",
      "difficulty": "medium",
      "expected_output": "SELECT customer_id, SUM(amount)..."
    }
  ]
}

Evaluate Coding Answer

curl -X POST https://api.yourapp.com/api/coding/evaluate \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "question": {"question": "Find top 5 customers"},
    "user_code": "SELECT customer_id, SUM(amount) FROM orders GROUP BY customer_id ORDER BY SUM(amount) DESC LIMIT 5",
    "language": "sql"
  }'
Evaluate user’s SQL or Pandas code submission.
question
object
required
Question object
user_code
string
required
User’s code solution
language
string
default:"sql"
Code language: sql or pandas
success
boolean
Request status
evaluation
object
Code evaluation results
{
  "success": true,
  "evaluation": {
    "is_correct": true,
    "score": 95,
    "feedback": "Great solution! Proper use of GROUP BY and ORDER BY. Consider adding column aliases for clarity."
  }
}

Get User Progress

Retrieves comprehensive progress statistics including mastery levels across topics.
GET /api/user/progress

Response

topics
object
Object containing mastery data by topic (DBMS, OOP, OS)
overall_stats
object
Overall progress statistics

Get User Masteries

Retrieves detailed mastery tracking data for all topics.
GET /api/user/masteries

Response

masteries
array
Array of UserMastery objects with concept-level tracking

Get Subtopic Statistics

Get statistics for subtopics within a topic.
GET /api/user/subtopic_stats?topic={topic}

Parameters

topic
string
required
Topic name (DBMS, OOP, or OS)

Get Subtopic Questions

Retrieve questions for a specific subtopic.
GET /api/user/subtopic/{topic}/{subtopic}/questions

Path Parameters

topic
string
required
Topic name
subtopic
string
required
Subtopic name

Generate Action Plan

Generate AI-powered study plan based on mastery gaps.
POST /api/generate_action_plan

Request Body

topic
string
required
Topic to generate plan for (DBMS, OOP, OS)

Response

plan
object
Generated action plan with weak concepts and recommended focus areas

Get Action Plans

Retrieve previously generated action plans for the user.
GET /api/profile/action_plans

Response

plans
array
Array of StudyActionPlan objects

Save Interview Session

Save a completed interview session with results.
POST /api/save_interview_session

Request Body

session_type
string
required
Type of session (mock, technical, coding, etc.)
questions
array
Questions asked during the session
score
number
Overall session score
feedback
string
AI-generated feedback
speech_metrics
object
Speech analysis metrics (WPM, fluency, etc.)

Error Responses

Status CodeDescription
400Bad request (missing required fields)
401Unauthorized (invalid/expired token)
404Resource not found
500Internal server error
{
  "success": false,
  "error": "No resume uploaded"
}

Build docs developers (and LLMs) love