diff --git a/frontend/src/pages/AIInterviewSessionDifficultyReview/AIInterviewSessionDifficultyReview.jsx b/frontend/src/pages/AIInterviewSessionDifficultyReview/AIInterviewSessionDifficultyReview.jsx new file mode 100644 index 00000000..5e30dd16 --- /dev/null +++ b/frontend/src/pages/AIInterviewSessionDifficultyReview/AIInterviewSessionDifficultyReview.jsx @@ -0,0 +1,1527 @@ +import React, { useMemo, useState } from "react"; +import { + Brain, + Gauge, + Target, + CheckCircle2, + AlertTriangle, + Clock3, + Lightbulb, + Sparkles, + TrendingUp, + BarChart3, + RefreshCw, + ArrowRight, + Award, + HelpCircle, + SkipForward, + Trophy, + Zap, + CircleAlert, + SlidersHorizontal, +} from "lucide-react"; + +const AIInterviewSessionDifficultyReview = () => { + const [selectedSession, setSelectedSession] = useState(0); + const [activeTab, setActiveTab] = useState("overview"); + const [analyzing, setAnalyzing] = useState(false); + + const sessions = [ + { + id: 1, + title: "Frontend Development Mock Interview", + date: "Today", + role: "Frontend Developer", + difficulty: "Medium", + difficultyScore: 58, + accuracy: 91, + completionTime: 24, + expectedTime: 30, + hintsUsed: 1, + skippedQuestions: 0, + questionsTotal: 12, + questionsAnswered: 12, + score: 91, + classification: "Too Easy", + recommendation: + "Increase the difficulty by introducing more advanced JavaScript, React architecture, and debugging questions.", + strengths: [ + "High accuracy across the session.", + "Completed every question.", + "Used very few hints.", + ], + challenges: [ + "Most questions were answered quickly.", + "Limited exposure to advanced scenarios.", + "Question difficulty was below your current ability.", + ], + nextDifficulty: "Medium-Hard", + nextFocus: [ + "Advanced React patterns", + "Performance optimization", + "Complex debugging scenarios", + ], + }, + { + id: 2, + title: "Data Structures & Algorithms Interview", + date: "Yesterday", + role: "Software Engineer", + difficulty: "Medium-Hard", + difficultyScore: 76, + accuracy: 79, + completionTime: 34, + expectedTime: 35, + hintsUsed: 3, + skippedQuestions: 1, + questionsTotal: 15, + questionsAnswered: 14, + score: 79, + classification: "Well Balanced", + recommendation: + "Maintain the current difficulty and gradually introduce more graph and dynamic programming problems.", + strengths: [ + "Good balance between speed and accuracy.", + "Successfully solved several challenging problems.", + "Used hints strategically.", + ], + challenges: [ + "Dynamic programming questions took longer.", + "One question was skipped.", + "Graph problems require more practice.", + ], + nextDifficulty: "Medium-Hard", + nextFocus: [ + "Graph algorithms", + "Dynamic programming", + "Time complexity analysis", + ], + }, + { + id: 3, + title: "Backend Engineering Mock Interview", + date: "3 days ago", + role: "Backend Developer", + difficulty: "Hard", + difficultyScore: 88, + accuracy: 67, + completionTime: 44, + expectedTime: 35, + hintsUsed: 7, + skippedQuestions: 2, + questionsTotal: 15, + questionsAnswered: 13, + score: 67, + classification: "Challenging", + recommendation: + "Keep the challenging level but focus on system design and database fundamentals before increasing difficulty further.", + strengths: [ + "Attempted most difficult questions.", + "Demonstrated strong problem-solving persistence.", + "Completed several advanced backend scenarios.", + ], + challenges: [ + "Several questions required multiple hints.", + "Completion time exceeded the target.", + "Two questions were skipped.", + ], + nextDifficulty: "Hard", + nextFocus: [ + "System design", + "Database optimization", + "API architecture", + ], + }, + { + id: 4, + title: "System Design Advanced Interview", + date: "1 week ago", + role: "Software Engineer", + difficulty: "Expert", + difficultyScore: 96, + accuracy: 42, + completionTime: 52, + expectedTime: 35, + hintsUsed: 11, + skippedQuestions: 4, + questionsTotal: 14, + questionsAnswered: 10, + score: 42, + classification: "Too Difficult", + recommendation: + "Reduce the difficulty temporarily and strengthen system design fundamentals before returning to expert-level questions.", + strengths: [ + "Attempted complex architecture questions.", + "Showed willingness to solve difficult problems.", + "Identified several important system components.", + ], + challenges: [ + "Accuracy dropped significantly.", + "Many hints were required.", + "Several questions were skipped.", + ], + nextDifficulty: "Medium-Hard", + nextFocus: [ + "System design fundamentals", + "Scalability concepts", + "Database architecture", + ], + }, + ]; + + const selected = sessions[selectedSession]; + + const averageAccuracy = useMemo(() => { + return Math.round( + sessions.reduce( + (sum, session) => sum + session.accuracy, + 0 + ) / sessions.length + ); + }, []); + + const averageDifficulty = useMemo(() => { + return Math.round( + sessions.reduce( + (sum, session) => sum + session.difficultyScore, + 0 + ) / sessions.length + ); + }, []); + + const balancedSessions = sessions.filter( + (session) => session.classification === "Well Balanced" + ).length; + + const challengingSessions = sessions.filter( + (session) => + session.classification === "Challenging" + ).length; + + const handleAnalyze = () => { + setAnalyzing(true); + + setTimeout(() => { + setAnalyzing(false); + setActiveTab("overview"); + }, 800); + }; + + const getClassificationColor = (classification) => { + switch (classification) { + case "Too Easy": + return "text-blue-600"; + case "Well Balanced": + return "text-green-600"; + case "Challenging": + return "text-orange-500"; + case "Too Difficult": + return "text-red-600"; + default: + return "text-gray-500"; + } + }; + + const getClassificationBg = (classification) => { + switch (classification) { + case "Too Easy": + return "bg-blue-100 dark:bg-blue-900/20"; + case "Well Balanced": + return "bg-green-100 dark:bg-green-900/20"; + case "Challenging": + return "bg-orange-100 dark:bg-orange-900/20"; + case "Too Difficult": + return "bg-red-100 dark:bg-red-900/20"; + default: + return "bg-gray-100 dark:bg-gray-800"; + } + }; + + const getDifficultyBar = (score) => { + if (score >= 85) return "bg-red-500"; + if (score >= 70) return "bg-orange-500"; + if (score >= 50) return "bg-violet-500"; + return "bg-blue-500"; + }; + + return ( +
+ Understand whether your mock interview was too easy, + well balanced, challenging, or too difficult. +
++ Sessions Reviewed +
+ ++ {sessions.length} +
+ ++ Average Accuracy +
+ ++ {averageAccuracy}% +
+ ++ Avg Difficulty +
+ ++ {averageDifficulty} +
+ ++ Balanced Sessions +
+ ++ {balancedSessions} +
+ ++ The AI evaluates question difficulty, accuracy, completion + time, hints used, and skipped questions to determine whether + each mock interview provided an appropriate level of challenge. +
+ ++ Selected Interview Session +
+ ++ {selected.role} • {selected.date} +
+ ++ AI Session Classification +
+ ++ {selected.classification} +
+ ++ Difficulty Fit +
+ ++ Based on your accuracy, time management, hint usage, + skipped questions, and the difficulty of the questions, + this session was classified as{" "} + + {selected.classification.toLowerCase()} + . +
+ ++ {selected.accuracy}% +
+ ++ Higher accuracy generally indicates that the current + difficulty is manageable. +
+ ++ {selected.completionTime}m +
+ ++ Expected completion time:{" "} + + {selected.expectedTime} minutes + +
+ ++ {selected.hintsUsed} +
+ ++ hints used during the session +
+ ++ Questions +
+ ++ {selected.questionsTotal} +
+ ++ Hint Rate +
+ ++ {Math.round( + (selected.hintsUsed / + selected.questionsTotal) * + 100 + )}% +
+ ++ {selected.skippedQuestions} +
+ ++ questions skipped during the session +
+ ++ Completion Rate +
+ ++ {Math.round( + (selected.questionsAnswered / + selected.questionsTotal) * + 100 + )}% +
+ ++ {strength} +
+ ++ {challenge} +
+ ++ {selected.recommendation} +
+ ++ Include targeted practice in this area before + increasing the interview difficulty. +
+ ++ {item.description} +
+ ++ {session.date} +
+ ++ {session.difficultyScore} +
+ ++ difficulty score +
+ ++ 🎯 +
+ ++ High accuracy may indicate that the current interview + difficulty is below your ability level. +
+ ++ ⏱️ +
+ ++ Completion time helps identify whether questions require + an appropriate amount of reasoning. +
+ ++ 🧠 +
+ ++ The goal is not maximum difficulty. The goal is productive + challenge that improves your skills. +
+ ++ Current Performance +
+ ++ Your current accuracy suggests that the selected session + provides a{" "} + {selected.classification.toLowerCase()} level of challenge. +
+ ++ Recommended Difficulty +
+ ++ This level should provide a productive challenge without + overwhelming your current skill level. +
+ ++ Main Goal +
+ ++ Maintain accuracy while gradually improving speed, + independence, and performance on challenging questions. +
+ ++ Your interview difficulty should adapt to your actual + performance rather than relying only on predefined + difficulty labels. Based on this session, the AI recommends + {selected.nextDifficulty} for your next + interview and suggests focusing on{" "} + {selected.nextFocus.join(", ")}. +
+ ++ {selected.nextDifficulty} +
+ +