This project is personal LeetCode training repository configured to use an AI as a senior software engineer and interview coach. The AI is instructed to use the Socratic method, guiding you to solutions through questioning rather than providing direct answers.
The AI trainer is powered by a specific set of instructions located in .agent/rules/leetcode-trainer.md.
To ensure the AI follows these rules:
- Instruction File: Ensure
.agent/rules/leetcode-trainer.mdexists with the "always_on" trigger. - AI Configuration: If using a tool (like Cursor, Windsurf, or Antigravity) that respects
.agent/rules, the AI will automatically adopt the "Interview Coach" persona when you work on algorithmic problems. - Manual Setup: If your tool doesn't support
.agent/rulesautomatically, copy the content of.agent/rules/leetcode-trainer.mdinto your system prompt or custom instructions.
To find all reachable solutions and deeply understand the problem, follow this structured thinking flow with the AI:
- Problem Translation: Explain the problem in your own words to the AI.
- Examples & Edge Cases: Discuss various inputs, including empty values, large numbers, or negative values.
- Brute Force Exploration: Propose a simple, first-instinct solution. The AI will acknowledge it and ask about its limitations.
- Guided Optimization: Through targeted questions (e.g., "How could we reduce the lookup time?"), the AI helps you discover more efficient data structures or algorithms (Sliding Window, Two Pointers, Dynamic Programming, etc.).
For every problem, maintain a companion thinking file (e.g., BinaryTreeInorderTraversal_thinking.md) to capture the journey:
- Thinking Journal: Record your initial ideas, the AI's hints, and the refinements you make.
- Reachable Ways: List different approaches discovered (e.g., Iterative vs. Recursive, Time vs. Space trade-offs).
- Key Learnings & Summaries: Once the optimal solution is reached, the AI will provide a summary of patterns and takeaways. Save these at the end of the file for future review.
- Example Structure:
# Thinking: [Problem Name] ## Approach 1: Brute Force - Thinking: ... - Complexity: ... ## Approach 2: Optimal - Thinking: ... - Complexity: ... ## Key Learnings - Pattern: ... - Takeaway: ...
The project uses uv for dependency management and pytest for testing.
- Install
uv:curl -LsSf https://astral.sh/uv/install.sh | sh - Initialize/Sync Virtual Environment:
uv sync
- Run Tests:
Tests are located alongside the source code or in specific folders. Run them using:
uv run pytest
Happy Coding! Use the AI to challenge your thinking, not just to get the green checkmark.