AI-Powered Interviews
Automated Technical Interviews
AI-powered interview generation and evaluation
Interview Generation
from sjm import SJM
client = SJM(api_key="your_api_key")
# Generate interview questions
interview = client.interview(
freelancer_id="f123",
project_description="Build a modern React Native app with TypeScript",
required_skills=["React Native", "TypeScript", "Mobile Development"],
job_title="Senior Mobile Developer",
mode="ai_questions"
)
# Get the session ID for later use
session_id = interview["data"]["session_id"]
# Access questions
questions = interview["data"]["interview_data"]["questions"]
for i, q in enumerate(questions, 1):
print(f"Q{i}: {q['text']}")
print(f"Scoring Criteria: {q['scoring_criteria']}")
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Response Evaluation
# Collect candidate answers
answers = [
"I have 5 years of experience with React Native...",
"For TypeScript integration, I typically start with strict mode...",
"My approach to state management in mobile apps involves..."
]
# Evaluate responses
evaluation = client.interview(
freelancer_id="f123",
project_description="Build a modern React Native app with TypeScript",
required_skills=["React Native", "TypeScript", "Mobile Development"],
job_title="Senior Mobile Developer",
mode="ai_full",
session_id=session_id,
provided_answers=answers
)
# Access evaluation results
eval_data = evaluation["data"]["evaluation"]
print(f"Technical Score: {eval_data['scores'][0]}")
print(f"Overall: {eval_data['overall_score']}/100")
print(f"Recommendation: {'Hire' if eval_data['hiring_recommendation'] else 'Do Not Hire'}")
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Interview Modes
SJM provides four interview modes for different use cases:
# AI generates both questions and evaluates answers
interview = client.interview(
freelancer_id="f123",
project_description="Build a modern web application",
required_skills=["React.js", "Node.js", "TypeScript"],
job_title="Full Stack Developer",
mode="ai_full"
)
1
2
3
4
5
6
7
8
Integration Example
import { SJM } from 'sjm';
import * as readline from 'readline';
// Initialize client
const client = new SJM({ apiKey: "your_api_key" });
// Create readline interface for user input
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
// Promisify question method
function question(query) {
return new Promise(resolve => rl.question(query, resolve));
}
async function conductInterview() {
try {
// 1. Generate interview questions
console.log("Generating interview questions...");
const interview = await client.interview({
freelancer_id: "f123",
project_description: "Build a modern web application with React",
required_skills: ["React.js", "Node.js", "TypeScript"],
job_title: "Full Stack Developer",
mode: "ai_questions"
});
// 2. Get session ID and questions
const sessionId = interview.data.session_id;
const questions = interview.data.interview_data.questions;
console.log(`\nGenerated ${questions.length} interview questions:\n`);
// 3. Collect answers from candidate
const answers = [];
for (let i = 0; i < questions.length; i++) {
console.log(`Q${i+1}: ${questions[i].text}`);
const answer = await question("Answer: ");
answers.push(answer);
}
// 4. Submit answers for evaluation
console.log("\nEvaluating responses...");
const evaluation = await client.interview({
freelancer_id: "f123",
project_description: "Build a modern web application with React",
required_skills: ["React.js", "Node.js", "TypeScript"],
job_title: "Full Stack Developer",
mode: "ai_full",
session_id: sessionId,
provided_answers: answers
});
// 5. Process evaluation results
const evalData = evaluation.data.evaluation;
console.log("\nEvaluation Results:");
console.log(`Overall Score: ${evalData.overall_score}/100`);
console.log("\nStrengths:");
for (const strength of evalData.strengths) {
console.log(`- ${strength}`);
}
console.log("\nAreas for Improvement:");
for (const area of evalData.areas_for_improvement) {
console.log(`- ${area}`);
}
console.log(`\nRecommendation: ${evalData.hiring_recommendation ? 'Hire' : 'Do Not Hire'}`);
console.log(`Reason: ${evalData.recommendation_reason}`);
rl.close();
} catch (error) {
console.error(`Error: ${error.message}`);
rl.close();
}
}
conductInterview();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80