A full-stack web application that generates tailored interview questions for any job position using AI. Powered by multiple LLM providers (Claude and Gemini), it delivers role-specific questions in seconds.
- Generate interview questions for any job title
- Choose between Claude and Gemini LLM providers
- Real-time loading feedback
- Input validation and prompt injection protection
- Clean, responsive UI built with React and TailwindCSS
- Serverless-ready deployment on Vercel
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite 8, TailwindCSS 4 |
| Backend | Node.js serverless functions (Express 5) |
| LLM Providers | Anthropic Claude, Google Gemini |
| Deployment | Vercel |
| Language | JavaScript + TypeScript |
interview-generator/
├── src/ # React frontend
│ ├── features/interview/
│ │ ├── InterviewQuestionGenerator.jsx # Main UI component
│ │ └── hooks/useInterviewQuestions.js # State & request hook
│ ├── services/llm/
│ │ └── interviewApiClient.js # HTTP client for API
│ └── shared/
│ ├── constants.js # Question count limits
│ ├── helpers.js # Response parsing utilities
│ ├── httpService.ts # Typed HTTP wrapper
│ ├── llmEnum.js # Provider constants
│ └── lang/en/index.ts # Error messages
│
├── api/ # Serverless API functions
│ └── llm/
│ ├── [provider]/
│ │ └── interview-question.ts # POST endpoint handler
│ └── _shared/
│ ├── contract.ts # Request/response types
│ ├── errorMapper.ts # Error normalization
│ ├── prompt.ts # Prompt construction & validation
│ ├── providers.ts # Claude and Gemini integration
│ └── validate-request.ts # Input validation
│
├── public/ # Static assets
├── vite.config.js # Vite configuration
├── vercel.json # Vercel deployment config
└── package.json
- Node.js 18+
- npm
- API keys for at least one LLM provider (Claude or Gemini)
git clone https://github.com/chinazagideon/interview-generator.git
cd interview-generator
npm installCreate a .env file in the project root:
# Claude (Anthropic)
CLAUDE_LLM_API_KEY=your_anthropic_api_key
CLAUDE_LLM_API_URL=https://api.anthropic.com/v1/messages
CLAUDE_LLM_MODEL=claude-sonnet-4-6
CLAUDE_LLM_MAX_TOKENS=1000
# Gemini (Google)
GEMINI_LLM_API_KEY=your_google_api_key
GEMINI_LLM_MODEL=gemini-2.0-flash
GEMINI_LLM_API_URL=https://generativelanguage.googleapis.com/v1betaYou only need to configure the provider(s) you intend to use.
npm run devThe app will be available at http://localhost:5173. API requests are proxied to the Vite dev server.
To run the API layer via Express locally, set:
VITE_USE_EXPRESS_PROXY=trueThen start the Express server alongside Vite (port 3000).
npm run build # Outputs to /dist
npm run preview # Preview the production build locallynpm run lintGenerates interview questions for a given job title.
URL Parameters
| Parameter | Values |
|---|---|
provider |
claude | gemini |
Request Body
{
"jobTitle": "Senior Software Engineer",
"count": 3
}| Field | Type | Required | Description |
|---|---|---|---|
jobTitle |
string | Yes | The job title (2–120 characters) |
count |
number | No | Number of questions (1–5, default: 3) |
Success Response (200)
{
"ok": true,
"data": {
"questions": [
"Describe your experience with distributed systems.",
"How do you approach code reviews?",
"Walk me through a technically challenging project."
]
},
"meta": {
"provider": "claude",
"model": "claude-sonnet-4-6",
"requestId": "req_01XYZ"
}
}Error Response
{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "jobTitle must be between 2 and 120 characters",
"retryable": false
},
"meta": {
"provider": "claude"
}
}Error Codes
| Code | HTTP Status | Description |
|---|---|---|
VALIDATION_ERROR |
400 | Invalid jobTitle or count |
BAD_PROVIDER |
400 | Unsupported provider value |
UPSTREAM_AUTH |
502 | LLM API key is invalid or missing |
UPSTREAM_RATE_LIMIT |
429 | LLM provider rate limit exceeded |
UPSTREAM_ERROR |
502 | LLM provider returned an error |
INTERNAL_ERROR |
500 | Unexpected server-side failure |
This app is configured for zero-config deployment on Vercel.
- Push to your GitHub repository
- Import the project in the Vercel dashboard
- Add your environment variables in the Vercel project settings
- Deploy — Vercel handles both the static frontend and serverless API functions automatically
The vercel.json configures:
- Build command:
npm run build - Output directory:
dist - Framework:
vite - Serverless functions are auto-detected from the
/apidirectory
- Prompt injection protection: Job title inputs are scanned for injection patterns before being sent to any LLM
- Input length limits: Job titles are capped at 120 characters; question count is capped at 5
- No user data stored: Questions are generated on-demand and not persisted
MIT