diff --git a/frontend/src/feat-pages/InterviewQuestionEdgeCaseGenerator.jsx b/frontend/src/feat-pages/InterviewQuestionEdgeCaseGenerator.jsx new file mode 100644 index 00000000..9905a581 --- /dev/null +++ b/frontend/src/feat-pages/InterviewQuestionEdgeCaseGenerator.jsx @@ -0,0 +1,855 @@ +import React, { useState } from "react"; +import { + Brain, + Bug, + CheckCircle2, + AlertTriangle, + Code2, + FlaskConical, + Target, + Zap, + RefreshCw, +} from "lucide-react"; + +const AIInterviewQuestionEdgeCaseGenerator = () => { + const [stats] = useState({ + coverageScore: 89, + generatedCases: 14, + passedCases: 11, + riskCases: 3, + }); + + const [selectedQuestion, setSelectedQuestion] = useState(0); + + const questions = [ + { + title: "Two Sum", + difficulty: "Easy", + coverage: 94, + }, + { + title: "Merge Intervals", + difficulty: "Medium", + coverage: 87, + }, + { + title: "LRU Cache", + difficulty: "Hard", + coverage: 82, + }, + ]; + + const edgeCases = [ + { + category: "Empty Input", + input: "[]", + description: "Tests how the solution handles an empty array.", + status: "Passed", + }, + { + category: "Single Element", + input: "[5]", + description: "Tests input containing only one element.", + status: "Passed", + }, + { + category: "Duplicate Values", + input: "[2, 2, 3, 4]", + description: "Checks whether duplicate values are handled correctly.", + status: "Passed", + }, + { + category: "Negative Values", + input: "[-5, -2, 0, 4]", + description: "Tests behavior with negative and zero values.", + status: "Review", + }, + { + category: "Large Input", + input: "[1...100000]", + description: "Evaluates performance on a very large input.", + status: "Passed", + }, + { + category: "Boundary Values", + input: "[−2³¹, 2³¹−1]", + description: "Tests values near integer boundaries.", + status: "Review", + }, + ]; + + const getStatusClasses = (status) => { + if (status === "Passed") { + return "bg-green-100 text-green-700 dark:bg-green-900/20 dark:text-green-400"; + } + + return "bg-orange-100 text-orange-700 dark:bg-orange-900/20 dark:text-orange-400"; + }; + + return ( +
+
+ + {/* Header */} + +
+ +
+ +
+ +
+ +

+ AI Interview Question Edge Case Generator +

+ +

+ Generate intelligent edge cases and test your interview + solutions against difficult and unexpected inputs. +

+ +
+ +
+ + {/* Dashboard Metrics */} + +
+ +
+ + + +

+ Edge Case Coverage +

+ +

+ {stats.coverageScore}% +

+ +
+ +
+ + + +

+ Generated Cases +

+ +

+ {stats.generatedCases} +

+ +
+ +
+ + + +

+ Passed Cases +

+ +

+ {stats.passedCases} +

+ +
+ +
+ + + +

+ Risk Cases +

+ +

+ {stats.riskCases} +

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

+ AI Edge Case Analysis +

+ +

+ The AI analyzes your interview problem and generates unusual, + boundary, and high-risk inputs that may expose hidden bugs. + Test your solution against these cases before submitting it. +

+ +
+ + {/* Question Selector */} + +
+ +
+ + + +

+ Select Interview Question +

+ +
+ +
+ + {questions.map((question, index) => ( + + + + ))} + +
+ +
+ + {/* Selected Question */} + +
+ +

+ Selected Question +

+ +

+ {questions[selectedQuestion].title} +

+ +
+ + + {questions[selectedQuestion].difficulty} + + + + Coverage: {questions[selectedQuestion].coverage}% + + +
+ +
+ + {/* Edge Case Categories */} + +
+ +
+ + + +

+ Generated Edge Case Categories +

+ +
+ +
+ + {[ + ["Empty Input", "[]", "Zero-element input"], + ["Single Element", "[5]", "One-element input"], + ["Duplicates", "[2,2,3]", "Repeated values"], + ["Large Input", "[1...100000]", "Performance stress"], + ["Boundary Values", "MIN / MAX", "Extreme values"], + ["Negative Values", "[-5,-2,0]", "Negative numbers"], + ["Sorted Input", "[1,2,3,4]", "Already sorted"], + ["Reversed Input", "[4,3,2,1]", "Reverse ordering"], + ].map(([title, example, description], index) => ( + +
+ +

+ {title} +

+ + + {example} + + +

+ {description} +

+ +
+ + ))} + +
+ +
+ + {/* Generated Edge Cases */} + +
+ +
+ +
+ + + +

+ AI Generated Edge Cases +

+ +
+ + + +
+ +
+ + {edgeCases.map((edgeCase, index) => ( + +
+ +
+ +
+ +

+ {edgeCase.category} +

+ + + {edgeCase.input} + + +

+ {edgeCase.description} +

+ +
+ + + {edgeCase.status} + + +
+ +
+ + ))} + +
+ +
+ {/* Edge Case Details */} + +
+ +
+ + + +

+ Edge Case Risk Analysis +

+ +
+ +
+ + {[ + { + title: "Negative Values", + risk: "Medium", + description: + "Your current solution may need additional validation when negative values are present.", + }, + { + title: "Boundary Values", + risk: "High", + description: + "Extreme integer values may expose overflow or comparison issues.", + }, + { + title: "Duplicate Values", + risk: "Low", + description: + "The current implementation appears to handle repeated values correctly.", + }, + { + title: "Large Input", + risk: "Low", + description: + "The current approach has acceptable complexity for large inputs.", + }, + ].map((item, index) => ( + +
+ +
+ +

+ {item.title} +

+ + + {item.risk} Risk + + +
+ +

+ {item.description} +

+ +
+ + ))} + +
+ +
+ + {/* Test Runner */} + +
+ +
+ +
+ + + +

+ Edge Case Test Runner +

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

+ Test Suite +

+ +

+ AI Generated Edge Cases +

+ +
+ +
+ +

+ 11 / 14 +

+ +

+ Cases Passed +

+ +
+ +
+ +
+ +
+ + {[ + ["Empty Input", "Passed"], + ["Single Element", "Passed"], + ["Duplicate Values", "Passed"], + ["Negative Values", "Needs Review"], + ["Large Input", "Passed"], + ["Boundary Values", "Needs Review"], + ].map(([test, status], index) => ( + +
+ +
+ + {status === "Passed" ? ( + + ) : ( + + )} + + + {test} + + +
+ + + {status} + + +
+ + ))} + +
+ +
+ + {/* Potential Bugs */} + +
+ +
+ + + +

+ Potential Bugs Detected +

+ +
+ +
+ + {[ + "Boundary integer values may require explicit validation.", + "Negative input handling should be tested before submission.", + "Confirm behavior when no valid result exists.", + ].map((bug, index) => ( + +
+ + + ⚠️ {bug} + + +
+ + ))} + +
+ +
+ + {/* AI Debugging Recommendations */} + +
+ +

+ AI Debugging Recommendations +

+ +
+ + {[ + "Test the solution with the smallest valid input.", + "Test values at both lower and upper boundaries.", + "Include duplicate values even when the normal example does not contain them.", + "Test negative values when the problem allows signed integers.", + "Run a large input to verify that the algorithm remains efficient.", + "Check what your solution returns when no valid answer exists.", + ].map((recommendation, index) => ( + +
+ + 💡 {recommendation} + +
+ + ))} + +
+ +
+ + {/* Edge Case Coverage Analytics */} + +
+ +

+ Edge Case Coverage Analytics +

+ + {[ + ["Empty Input", 100], + ["Single Element", 100], + ["Duplicate Values", 95], + ["Negative Values", 72], + ["Large Input", 91], + ["Boundary Values", 64], + ["Sorted / Reversed Input", 88], + ].map(([label, value], index) => ( + +
+ +
+ + {label} + + {value}% + +
+ +
+ +
+ +
+ +
+ + ))} + +
+ + {/* Robustness Score */} + +
+ +
+ +
+ +

+ Solution Robustness Score +

+ +

+ Your solution handles most generated cases successfully. + Strengthen boundary-value and negative-value testing + before submitting the final answer. +

+ +
+ +
+ +

+ {stats.coverageScore}% +

+ +

+ Robustness +

+ +
+ +
+ +
+ +
+ +
+ +
+ + {/* Practice Checklist */} + +
+ +

+ Edge Case Testing Checklist +

+ +
+ + {[ + ["🕳️", "Empty Input", "Check zero-element input."], + ["1️⃣", "Single Element", "Check the smallest input."], + ["🔁", "Duplicates", "Test repeated values."], + ["📈", "Large Input", "Stress test performance."], + ["🚧", "Boundaries", "Test minimum and maximum values."], + ["➖", "Negative Values", "Test signed inputs."], + ["↕️", "Sorted Input", "Test already sorted data."], + ["🔃", "Reversed Input", "Test reverse ordering."], + ].map(([icon, title, description], index) => ( + +
+ +
+ {icon} +
+ +

+ {title} +

+ +

+ {description} +

+ +
+ + ))} + +
+ +
+ + {/* Motivation */} + +
+ +
+ +
+ +

+ Think Beyond the Happy Path 🚀 +

+ +

+ Strong coding solutions are designed for more than the + example input. Testing unusual, boundary, and unexpected + cases helps you discover hidden bugs and build solutions + that are ready for real technical interviews. +

+ +
+ +
+ +
+ 🧪 +
+ +

+ Coverage +

+ +

+ {stats.coverageScore}% +

+ +
+ +
+ +
+ +
+
+ ); +}; + +export default AIInterviewQuestionEdgeCaseGenerator; \ No newline at end of file diff --git a/frontend/src/pages/AIInterviewAnswerConfidenceScore/AIInterviewAnswerConfidenceScore.jsx b/frontend/src/pages/AIInterviewAnswerConfidenceScore/AIInterviewAnswerConfidenceScore.jsx new file mode 100644 index 00000000..95e208b2 --- /dev/null +++ b/frontend/src/pages/AIInterviewAnswerConfidenceScore/AIInterviewAnswerConfidenceScore.jsx @@ -0,0 +1,214 @@ +""import React, { useState } from "react"; +import { + TrendingUp, + ThumbsUp, + ThumbsDown, + Shield, + Brain, + Target, + Zap, + BarChart3, +} from "lucide-react"; + +const AIInterviewAnswerConfidenceScore = () => { + const [selectedQuestion, setSelectedQuestion] = useState(0); + + const stats = { overallConfidence: 71, assertivenessScore: 68, wordStrength: 75, hedgingCount: 3 }; + + const questions = [ + { title: "Why should we hire you over other candidates?", category: "HR" }, + { title: "Describe a time you failed and how you handled it.", category: "Behavioral" }, + { title: "Walk me through your most complex technical project.", category: "Technical" }, + ]; + + const answerWords = [ + { text: "I", confidence: "neutral" }, { text: "believe", confidence: "confident" }, + { text: "my", confidence: "neutral" }, { text: "technical", confidence: "neutral" }, + { text: "skills", confidence: "neutral" }, { text: "are", confidence: "neutral" }, + { text: "very", confidence: "confident" }, { text: "strong", confidence: "confident" }, + { text: "and", confidence: "neutral" }, { text: "I", confidence: "neutral" }, + { text: "think", confidence: "hedging" }, { text: "I", confidence: "neutral" }, + { text: "could", confidence: "hedging" }, { text: "bring", confidence: "neutral" }, + { text: "a", confidence: "neutral" }, { text: "lot", confidence: "confident" }, + { text: "of", confidence: "neutral" }, { text: "value", confidence: "confident" }, + { text: "to", confidence: "neutral" }, { text: "the", confidence: "neutral" }, + { text: "team.", confidence: "neutral" }, { text: "Maybe", confidence: "hedging" }, + { text: "my", confidence: "neutral" }, { text: "experience", confidence: "neutral" }, + { text: "is", confidence: "neutral" }, { text: "exactly", confidence: "confident" }, + { text: "what", confidence: "neutral" }, { text: "you", confidence: "neutral" }, + { text: "need.", confidence: "neutral" }, + ]; + + const confidenceBreakdown = [ + { category: "Assertiveness", score: 68, description: "Direct statements vs. qualified language", color: "blue" }, + { category: "Word Strength", score: 75, description: "Use of powerful, action-oriented words", color: "green" }, + { category: "Hedging Language", score: 55, description: "Minimizing uncertain phrases", color: "red" }, + { category: "Tone Consistency", score: 80, description: "Uniform confidence throughout answer", color: "violet" }, + ]; + + const suggestions = [ + { icon: , text: "Remove 'I think' and 'maybe' when you are confident in your statement." }, + { icon: , text: "Replace 'I could bring value' with 'I will deliver measurable impact'." }, + { icon: , text: "Lead with your strongest qualification instead of qualifying it." }, + { icon: , text: "Use more action verbs: 'I built', 'I led', 'I delivered'." }, + ]; + + const sessionComparison = [ + { session: "Session 1", score: 52 }, { session: "Session 2", score: 58 }, + { session: "Session 3", score: 64 }, { session: "Session 4", score: 68 }, + { session: "Current", score: 71 }, + ]; + + const getWordClass = (confidence) => { + if (confidence === "confident") return "text-green-600 font-semibold bg-green-50 dark:bg-green-900/20 px-1 rounded"; + if (confidence === "hedging") return "text-red-500 font-semibold bg-red-50 dark:bg-red-900/20 px-1 rounded"; + return ""; + }; + + const getScoreColor = (score) => { + if (score >= 70) return "text-green-600"; + if (score >= 50) return "text-amber-500"; + return "text-red-500"; + }; + + const getBarColor = (color) => { + if (color === "green") return "bg-gradient-to-r from-green-500 to-emerald-600"; + if (color === "blue") return "bg-gradient-to-r from-blue-500 to-indigo-600"; + if (color === "violet") return "bg-gradient-to-r from-violet-500 to-purple-600"; + return "bg-gradient-to-r from-red-500 to-orange-500"; + }; + + return ( +
+
+
+
+ +
+
+

AI Interview Answer Confidence Score

+

Analyze the confidence level of your interview answers by examining word choice, assertiveness, and hedging language.

+
+
+ +
+ {[ + { icon: , label: "Overall Confidence", value: `${stats.overallConfidence}%` }, + { icon: , label: "Assertiveness Score", value: `${stats.assertivenessScore}%` }, + { icon: , label: "Word Strength", value: `${stats.wordStrength}%` }, + { icon: , label: "Hedging Instances", value: stats.hedgingCount }, + ].map((item, i) => ( +
+ {item.icon} +

{item.label}

+

{item.value}

+
+ ))} +
+ +
+

AI Confidence Analysis

+

The AI analyzes your interview answers for confidence signals, including word strength, hedging language, and assertiveness. Confident answers make a stronger impression on interviewers and demonstrate competence.

+
+ +
+

Select Interview Question

+
+ {questions.map((q, i) => ( + + ))} +
+
+ +
+

Answer with Confidence Highlights

+
+

+ {answerWords.map((item, i) => ( + {item.text} + ))} +

+
+
+ {[ + { label: "Confident", color: "bg-green-500" }, + { label: "Hedging", color: "bg-red-500" }, + { label: "Neutral", color: "bg-gray-300" }, + ].map((item, i) => ( +
+ + {item.label} +
+ ))} +
+
+ +
+

Confidence Breakdown

+
+ {confidenceBreakdown.map((item, i) => ( +
+
+
+ {item.category} +

{item.description}

+
+ {item.score}% +
+
+
+
+
+ ))} +
+
+ +
+

Confidence Improvement Suggestions

+
+ {suggestions.map((item, i) => ( +
+
{item.icon}
+

{item.text}

+
+ ))} +
+
+ +
+

Confidence Trend Over Sessions

+
+ {sessionComparison.map((s, i) => ( +
+

{s.session}

+

{s.score}%

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

Interview Confidence Readiness

+

Your answer shows moderate confidence with room for improvement. Focus on eliminating hedging language and using more assertive, action-oriented words to project greater competence.

+
+
+

{stats.overallConfidence}%

+

Good Confidence

+
+
+
+
+
+
+
+
+ ); +}; + +export default AIInterviewAnswerConfidenceScore;