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 ( +
+
+ + {/* Header */} + +
+ +
+ +
+ +
+

+ AI Interview Session Difficulty Review +

+ +

+ Understand whether your mock interview was too easy, + well balanced, challenging, or too difficult. +

+
+ +
+ + {/* Overview Cards */} + +
+ +
+ + + +

+ Sessions Reviewed +

+ +

+ {sessions.length} +

+ +
+ +
+ + + +

+ Average Accuracy +

+ +

+ {averageAccuracy}% +

+ +
+ +
+ + + +

+ Avg Difficulty +

+ +

+ {averageDifficulty} +

+ +
+ +
+ + + +

+ Balanced Sessions +

+ +

+ {balancedSessions} +

+ +
+ +
+ + {/* AI Banner */} + +
+ +
+ + + +

+ AI Difficulty Review Engine +

+ +
+ +

+ 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. +

+ +
+ + {/* Session Selector */} + +
+ +
+ + + +

+ Select Interview Session +

+ +
+ +
+ + {sessions.map((session, index) => ( + + + + ))} + +
+ +
+ + {/* Selected Session */} + +
+ +
+ +
+ +

+ Selected Interview Session +

+ +

+ {selected.title} +

+ +

+ {selected.role} • {selected.date} +

+ +
+ +
+ + + {selected.classification} + + +

+ AI Session Classification +

+ +
+ +
+ +
+ + {/* Review Tabs */} + +
+ + {[ + ["overview", "AI Review"], + ["metrics", "Session Metrics"], + ["strengths", "Strengths & Challenges"], + ["recommendation", "Next Session"], + ].map(([value, label]) => ( + + + + ))} + +
+ + {/* AI Review */} + + {activeTab === "overview" && ( + +
+ +
+ +
+ + + +

+ AI Difficulty Assessment +

+ +
+ +
+ +
+ +
+ + + +

+ {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()} + . +

+ +
+ +
+ +
+ + + +

+ Why This Classification? +

+ +
+ +
+ +
+ +
+ + + + + Accuracy + + + + {selected.accuracy}% + + +
+ +
+ +
+ +
+ + + + + Completion Time + + + + {selected.completionTime}m + + +
+ +
+ +
+ +
+ + + + + Hints Used + + + + {selected.hintsUsed} + + +
+ +
+ +
+ +
+ + + + + Skipped Questions + + + + {selected.skippedQuestions} + + +
+ +
+ +
+ +
+ +
+ )} + + {/* Metrics */} + + {activeTab === "metrics" && ( + +
+ +
+ +
+ + + +

+ Accuracy +

+ +
+ +
+ +

+ {selected.accuracy}% +

+ + + +
+ +
+ +
+ +
+ +

+ Higher accuracy generally indicates that the current + difficulty is manageable. +

+ +
+ +
+ +
+ + + +

+ Completion Time +

+ +
+ +
+ +

+ {selected.completionTime}m +

+ + + +
+ +
+ +
+ +
+ +

+ Expected completion time:{" "} + + {selected.expectedTime} minutes + +

+ +
+ +
+ +
+ + + +

+ Hint Usage +

+ +
+ +

+ {selected.hintsUsed} +

+ +

+ hints used during the session +

+ +
+ +
+ +

+ Questions +

+ +

+ {selected.questionsTotal} +

+ +
+ +
+ +

+ Hint Rate +

+ +

+ {Math.round( + (selected.hintsUsed / + selected.questionsTotal) * + 100 + )}% +

+ +
+ +
+ +
+ +
+ +
+ + + +

+ Skipped Questions +

+ +
+ +

+ {selected.skippedQuestions} +

+ +

+ questions skipped during the session +

+ +
+ +

+ Completion Rate +

+ +

+ {Math.round( + (selected.questionsAnswered / + selected.questionsTotal) * + 100 + )}% +

+ +
+ +
+ +
+ )} + + {/* Strengths & Challenges */} + + {activeTab === "strengths" && ( + +
+ +
+ +
+ + + +

+ What Went Well +

+ +
+ +
+ + {selected.strengths.map((strength, index) => ( + +
+ +
+ + + +

+ {strength} +

+ +
+ +
+ + ))} + +
+ +
+ +
+ +
+ + + +

+ Areas to Improve +

+ +
+ +
+ + {selected.challenges.map((challenge, index) => ( + +
+ +
+ + + +

+ {challenge} +

+ +
+ +
+ + ))} + +
+ +
+ +
+ )} + + {/* Recommendation */} + + {activeTab === "recommendation" && ( + +
+ +
+ +
+ + + +

+ AI Recommendation for Next Session +

+ +
+ +
+ +
+ + + +

+ Recommended Difficulty:{" "} + {selected.nextDifficulty} +

+ +
+ +

+ {selected.recommendation} +

+ +
+ +
+ +

+ Recommended Focus Areas +

+ +
+ + {selected.nextFocus.map((focus, index) => ( + +
+ +
+ + + +
+ +

+ {focus} +

+ +

+ Include targeted practice in this area before + increasing the interview difficulty. +

+ +
+ + ))} + +
+ +
+ +
+ +
+ )} + + {/* Difficulty Scale */} + +
+ +
+ + + +

+ AI Difficulty Classification Scale +

+ +
+ +
+ + {[ + { + title: "Too Easy", + description: + "High accuracy, fast completion, and minimal hint usage.", + icon: "🟦", + color: "text-blue-600", + }, + { + title: "Well Balanced", + description: + "Good accuracy with reasonable time and moderate challenge.", + icon: "🟢", + color: "text-green-600", + }, + { + title: "Challenging", + description: + "Lower accuracy or higher time, but the session remains productive.", + icon: "🟠", + color: "text-orange-500", + }, + { + title: "Too Difficult", + description: + "Low accuracy, excessive hints, long completion time, or many skips.", + icon: "🔴", + color: "text-red-600", + }, + ].map((item) => ( + +
+ +
+ {item.icon} +
+ +

+ {item.title} +

+ +

+ {item.description} +

+ +
+ + ))} + +
+ +
+ + {/* Difficulty Comparison */} + +
+ +
+ + + +

+ Session Difficulty Comparison +

+ +
+ +
+ + {sessions.map((session) => ( + +
+ +
+ + + {session.title} + + + + {session.classification} + + +
+ +
+ +
+ +
+ +
+ + + Difficulty: {session.difficultyScore}/100 + + + + Accuracy: {session.accuracy}% + + +
+ +
+ + ))} + +
+ +
+ + {/* Session Trend */} + +
+ +
+ + + +

+ Interview Difficulty Trend +

+ +
+ +
+ + {sessions.map((session) => ( + +
+ +

+ {session.date} +

+ +

+ {session.difficultyScore} +

+ +

+ difficulty score +

+ +
+ +
+ +
+ +
+ + ))} + +
+ +
+ + {/* AI Principles */} + +
+ +
+ + + +

+ AI Difficulty Review Principles +

+ +
+ +
+ +
+ +

+ 🎯 +

+ +

+ Accuracy Matters +

+ +

+ High accuracy may indicate that the current interview + difficulty is below your ability level. +

+ +
+ +
+ +

+ ⏱️ +

+ +

+ Time Reveals Challenge +

+ +

+ Completion time helps identify whether questions require + an appropriate amount of reasoning. +

+ +
+ +
+ +

+ 🧠 +

+ +

+ Use Challenge Strategically +

+ +

+ The goal is not maximum difficulty. The goal is productive + challenge that improves your skills. +

+ +
+ +
+ +
+ + {/* Personalized Recommendation */} + +
+ +
+ + + +

+ AI Personalized Session Strategy +

+ +
+ +
+ +
+ +

+ Current Performance +

+ +

+ {selected.accuracy}% Accuracy +

+ +

+ Your current accuracy suggests that the selected session + provides a{" "} + {selected.classification.toLowerCase()} level of challenge. +

+ +
+ +
+ +

+ Recommended Difficulty +

+ +

+ {selected.nextDifficulty} +

+ +

+ This level should provide a productive challenge without + overwhelming your current skill level. +

+ +
+ +
+ +

+ Main Goal +

+ +

+ Improve Consistency +

+ +

+ Maintain accuracy while gradually improving speed, + independence, and performance on challenging questions. +

+ +
+ +
+ +
+ + {/* Analyze Button */} + +
+ + + +
+ + {/* Final Insight */} + +
+ +
+ +
+ +
+ + + +

+ AI Final Insight +

+ +
+ +

+ 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(", ")}. +

+ +
+ +
+ +
+ 🎯 +
+ +

+ Next Level +

+ +

+ {selected.nextDifficulty} +

+ +
+ +
+ +
+ +
+
+ ); +}; + +export default AIInterviewSessionDifficultyReview; \ No newline at end of file