Skip to content

feat: Add difficulty level support for AI-generated interview questions #261

Description

@nightfury-devai

Describe the feature

Currently, generateInterviewQuestions in aiController.js generates questions based only on role, experience, topics, and number of questions. There's no way to control question difficulty (easy/medium/hard).

Why this is needed

Users preparing for interviews at different stages need different difficulty levels — a beginner wants foundational questions while someone preparing for a senior role wants advanced questions. Right now, difficulty is implicitly tied only to "experience" which isn't precise enough.

Proposed solution

Add a difficulty parameter ("easy", "medium", "hard") to the /api/ai/generate-questions endpoint and pass it into the prompt in questionAnswerPrompt() so Gemini tailors question complexity accordingly.

Files to modify

  • backend/controllers/aiController.js
  • backend/utils/prompts.js

Acceptance criteria

  • API accepts optional difficulty field
  • Defaults to "medium" if not provided
  • Prompt sent to Gemini reflects the chosen difficulty
  • Existing functionality unaffected if difficulty is omitted

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions