Add LeetCode Enrichment and LLM-Based Problem-Solving Evaluation #173
+345
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR address this issues #172
This PR enhances the Hiring Agent by introducing LeetCode profile enrichment and a new Problem Solving (0–15) evaluation category powered by LLM-based reasoning.
The system now fetches candidate statistics from the LeetCode GraphQL API, parses key metrics such as problems solved, contest rating, and activity consistency, and passes them as context to the LLM for evaluation.
The score is display-only and excluded from the total 100-point score, ensuring compatibility with previous versions.
What this feature adds:
LeetCode Data Integration (leetcode.py)
• Added support for fetching, caching, and parsing LeetCode profile data via the GraphQL API.
• Introduced a LeetCodeProfile model for structured handling (similar to GitHubProfile).
LLM-Based Problem Solving Evaluation
• Integrated LeetCode data into the LLM evaluation pipeline.
• Updated prompt template to include the Problem Solving (0–15) section, using LeetCode stats for reasoning.
• Score is shown in output but excluded from total 100-point calculation.
Error Handling Improvements⚠️ Invalid profile URL → prints a warning, sets score = 0.
• Handled all three possible cases cleanly:
• ✅ Valid LeetCode profile → full scoring and cache creation.
•
• 🚫 No LeetCode profile in resume → skips section safely.
• Prevented crashes for bad or empty responses from the LeetCode API.
Consistent Caching
• Followed GitHub caching style — one JSON file per username.
• Stored under /cache for development mode and loaded automatically if exists.
Files Changed:
Testing & Results
The feature has been tested with multiple resumes to verify correct handling of all cases.
Below are the test scenarios with expected behavior (screenshots are attached under each case):
✅ Case 1 — Valid LeetCode Profile


Description: Resume includes a valid LeetCode URL
Expected Behavior:
• Data fetched and cached correctly and Problem solving result shown.
Description: Resume includes a broken or incorrect URL
Expected Behavior:
• Warning printed: “
• Problem Solving section still displayed but score = 0/15 with fallback evidence
🚫 Case 3 — No LeetCode Profile Provided

Description: Resume has no LeetCode link in basics section
Expected Behavior:
• Skips fetching
Cache File Verification
Description: Verified cache behavior after successful runs.

Expected Behavior:
• Only one cache file created per user → e.g., leetcodecache_username.json
• JSON contains parsed user data (problems solved, contest rating, etc.)
Workflow Summary