Interview API Documentation

AI-powered interview system with Google Gemini integration for question customization and feedback generation.

GET/health

Description: Health check endpoint to verify API status

Request:

curl -X GET http://localhost:8080/health

Response:

{
  "status": "ok",
  "message": "Interview API is running"
}

POST/api/interview/session

Description: Create a new interview session with candidate details

Request:

curl -X POST http://localhost:8080/api/interview/session \\
  -H "Content-Type: application/json" \\
  -d '{...}'

Payload:

{
  "parsedResumeText": "Experienced software engineer with 5 years in React and Node.js development. Led multiple teams and delivered scalable applications.",
  "jobTitle": "Senior Software Engineer",
  "jobInfo": "We are looking for a senior engineer to lead our frontend team and build scalable React applications.",
  "companyName": "TechCorp",
  "additionalInfo": "Remote work, competitive benefits",
  "typeOfInterview": "behavioral",
  "behaviouralTopics": ["Leadership", "Problem Solving", "Adaptability"],
  "technicalDifficulty": "Medium"
}

Response:

{
  "sessionId": "550e8400-e29b-41d4-a716-446655440000"
}

GET/api/interview-questions

Description: Get AI-customized interview questions based on session

Parameters:

Request:

curl -X GET "http://localhost:8080/api/interview-questions?sessionId=550e8400-e29b-41d4-a716-446655440000"

Response:

{
  "sessionId": "550e8400-e29b-41d4-a716-446655440000",
  "questions": [
    {
      "id": "q1",
      "topic": "Leadership",
      "question": "TechCorp values mentorship. Tell me about a time you successfully guided a junior React developer to overcome a performance bottleneck in a complex component. How did you approach their learning, and what was the final impact on the application's performance?",
      "hints": [
        "What was the specific performance issue the junior developer was facing?",
        "What specific mentoring techniques or approaches did you use?",
        "What measurable improvements were achieved in the component's performance?"
      ]
    },
    {
      "id": "q2",
      "topic": "Problem Solving",
      "question": "TechCorp prioritizes delivering high-performing applications. Tell me about a time you used performance monitoring tools and data analysis to identify and resolve a significant performance bottleneck in a React application.",
      "hints": [
        "What specific metrics did you track?",
        "What was your diagnostic process?",
        "What impact did your solution have on the user experience?"
      ]
    },
    {
      "id": "q3",
      "topic": "Adaptability",
      "question": "At TechCorp, you might be communicating technical details to different audiences. Describe how you adapt your communication style when explaining complex React frontend architectures.",
      "hints": [
        "What specific adjustments did you make for each audience?",
        "How did you ensure everyone was aligned and understood the information?",
        "What was the outcome of your communication approach?"
      ]
    }
  ]
}

POST/api/interview/feedback

Description: Generate AI-powered interview feedback based on candidate responses

Request:

curl -X POST http://localhost:8080/api/interview/feedback \\
  -H "Content-Type: application/json" \\
  -d '{...}'

Payload:

{
  "sessionId": "550e8400-e29b-41d4-a716-446655440000",
  "interviewQuestionsWithAnswers": [
    {
      "question": "Tell me about a time you led a technical team",
      "answer": "I led a team of 5 developers to migrate our legacy system to React. We faced performance issues and tight deadlines. I organized daily standups, delegated specific tasks based on each developer's strengths, and implemented code review processes. The result was a 40%!i(MISSING)mprovement in application performance and the team gained valuable React expertise."
    },
    {
      "question": "Describe a time you solved a complex technical problem",
      "answer": "Our React application was experiencing memory leaks causing crashes. I used React DevTools profiler to identify the issue was in our useEffect cleanup. I implemented proper dependency arrays and cleanup functions, reducing memory usage by 60%!a(MISSING)nd eliminating crashes."
    }
  ]
}

Response:

{
  "sessionId": "550e8400-e29b-41d4-a716-446655440000",
  "interviewQuestionFeedback": [
    {
      "question": "Tell me about a time you led a technical team",
      "score": 8,
      "strengths": [
        "Clearly articulated the situation and task at hand",
        "Demonstrated leadership by organizing standups and delegating tasks",
        "Quantified results with specific improvements"
      ],
      "areasForImprovement": [
        "Could elaborate on the specific technical challenges faced",
        "Could provide more detail about the team's individual contributions",
        "Could discuss lessons learned from the experience"
      ]
    },
    {
      "question": "Describe a time you solved a complex technical problem",
      "score": 9,
      "strengths": [
        "Showed strong technical problem-solving skills",
        "Used appropriate tools for diagnosis",
        "Provided specific, measurable results"
      ],
      "areasForImprovement": [
        "Could explain the broader impact on the application",
        "Could discuss preventive measures implemented"
      ]
    }
  ],
  "hireAbilityScore": 87,
  "overallFeedback": [
    "Strong technical leadership with clear communication and measurable results",
    "Excellent problem-solving approach using appropriate tools and methodologies",
    "Consider expanding on broader impact and preventive measures for even stronger responses"
  ]
}

GET/api/technical-question

Description: Get a random technical question by difficulty level

Parameters:

Request:

curl -X GET "http://localhost:8080/api/technical-question?difficulty=Medium"

Response:

{
  "id": "68e205dadb8a0fc4ec6924e9",
  "difficulty": "Medium",
  "question": {
    "question": "Rotting Oranges",
    "description": "You are given an m x n grid where each cell can have one of three values: 0 representing an empty cell, 1 representing a fresh orange, or 2 representing a rotten orange. Every minute, any fresh orange that is 4-directionally adjacent to a rotten orange becomes rotten. Return the minimum number of minutes that must elapse until no cell has a fresh orange. If this is impossible, return -1.",
    "functionName": "rottenOranges",
    "testCases": [
      {
        "input": "[[2,1,1],[1,1,0],[0,1,1]]",
        "expectedOutput": "4"
      },
      {
        "input": "[[2,1,1],[0,1,1],[1,0,1]]",
        "expectedOutput": "-1"
      },
      {
        "input": "[[0,2]]",
        "expectedOutput": "0"
      }
    ]
  }
}

POST/api/hint

Description: Generate AI-powered hints for interview responses with text-to-speech support

Request:

curl -X POST http://localhost:8080/api/hint \\
  -H "Content-Type: application/json" \\
  -d '{...}'

Payload:

{
  "sessionId": "550e8400-e29b-41d4-a716-446655440000",
  "questionId": "68e205dadb8a0fc4ec6924e9",
  "previousHints": ["Think about dynamic programming", "Consider the recursive relationship"],
  "userCode": "function lcs(str1, str2) {\n  // My current attempt\n  return '';\n}",
  "userSpeech": "I'm trying to implement this function but I'm not sure where to start. Can you help me?"
}

Response:

{
  "sessionId": "550e8400-e29b-41d4-a716-446655440000",
  "conversationalHint": "Great start! I can see you're thinking about this problem. Let me guide you - consider what happens when you compare characters at each position. What would you do if the characters match versus when they don't match?",
  "hintSummary": "Consider character comparison logic for matching vs non-matching cases"
}

POST/api/execute-code

Description: Execute user-submitted code against test cases for technical questions

Request:

curl -X POST http://localhost:8080/api/execute-code \\
  -H "Content-Type: application/json" \\
  -d '{...}'

Payload:

{
  "questionId": "68e205dadb8a0fc4ec6924e9",
  "code": "def rottenOranges(grid):\n    if not grid or not grid[0]:\n        return -1\n    \n    m, n = len(grid), len(grid[0])\n    queue = []\n    fresh = 0\n    \n    # Find all rotten oranges and count fresh ones\n    for i in range(m):\n        for j in range(n):\n            if grid[i][j] == 2:\n                queue.append((i, j, 0))\n            elif grid[i][j] == 1:\n                fresh += 1\n    \n    if fresh == 0:\n        return 0\n    \n    directions = [(0,1), (1,0), (0,-1), (-1,0)]\n    \n    while queue:\n        i, j, time = queue.pop(0)\n        \n        for di, dj in directions:\n            ni, nj = i + di, j + dj\n            if 0 <= ni < m and 0 <= nj < n and grid[ni][nj] == 1:\n                grid[ni][nj] = 2\n                fresh -= 1\n                if fresh == 0:\n                    return time + 1\n                queue.append((ni, nj, time + 1))\n    \n    return -1",
  "language": "python"
}

Response (Success):

{
  "questionId": "68e205dadb8a0fc4ec6924e9",
  "code": "def rottenOranges(grid):...",
  "language": "python",
  "output": "4\n-1\n0",
  "error": "",
  "executionTime": 200,
  "success": true
}

Response (Compilation Error):

{
  "questionId": "68e205dadb8a0fc4ec6924e9",
  "code": "def rottenOranges(grid):...",
  "language": "python",
  "output": "",
  "error": "Compilation Error: SyntaxError: expected ':'",
  "executionTime": 50,
  "success": false
}

Response (Wrong Answer):

{
  "questionId": "68e205dadb8a0fc4ec6924e9",
  "code": "def rottenOranges(grid):...",
  "language": "python",
  "output": "1\n1\n0",
  "error": "Test case 1: Expected '4', got '1'\nTest case 2: Expected '-1', got '1'",
  "executionTime": 150,
  "success": false
}

Supported Languages:

Error Types:

POST/api/technical-feedback

Description: Generate AI-powered technical feedback based on candidate's performance, job context, and code quality

Request:

curl -X POST http://localhost:8080/api/technical-feedback \\
  -H "Content-Type: application/json" \\
  -d '{...}'

Payload:

{
  "sessionId": "ca781b1f-6d27-4a66-b6c1-ba597b76fee1",
  "questionId": "68e205e6db8a0fc4ec6924ea",
  "userCode": "def rottenOranges(grid):\n    if not grid or not grid[0]:\n        return -1\n    \n    m, n = len(grid), len(grid[0])\n    queue = []\n    fresh = 0\n    \n    for i in range(m):\n        for j in range(n):\n            if grid[i][j] == 2:\n                queue.append((i, j, 0))\n            elif grid[i][j] == 1:\n                fresh += 1\n    \n    if fresh == 0:\n        return 0\n    \n    return 1",
  "hintsUsed": 2,
  "isCompleted": false,
  "timeTaken": 300
}

Response:

{
  "sessionId": "ca781b1f-6d27-4a66-b6c1-ba597b76fee1",
  "hireAbilityScore": 75,
  "suggestions": [
    "Consider implementing a BFS algorithm to solve this problem more efficiently",
    "Add more comments to explain your logic and approach",
    "Handle edge cases more thoroughly, especially for empty grids"
  ],
  "strengths": [
    "Good understanding of the problem structure",
    "Clean code organization and variable naming",
    "Proper handling of the base case when no fresh oranges exist"
  ]
}

Features:

Available Behavioral Topics

Interview Types

Technical Difficulty Levels