An AI-powered technical interview training platform that teaches engineers how to solve problems, not just memorize solutions.
LeetPattern guides users through a structured 6-step interview framework used in real software engineering interviews. Instead of jumping directly into coding, users must first demonstrate understanding, clarify requirements, plan an approach, test their reasoning, and analyze complexity before completing a challenge.
While preparing for technical interviews, I noticed that most platforms focus heavily on solving large volumes of coding problems.
Although that helps build familiarity with common patterns, it often encourages memorization rather than the structured thinking expected during real interviews.
In actual interviews, candidates are evaluated on far more than whether their code passes test cases. Interviewers want to understand how candidates:
- Break down requirements
- Identify ambiguities
- Discuss tradeoffs
- Design solutions
- Validate assumptions
- Analyze complexity
I built LeetPattern to enforce this workflow and provide AI-guided feedback throughout the process.
Users progress through the same stages commonly used in technical interviews:
- Understand — Restate the problem in your own words
- Clarify — Ask questions about constraints and edge cases
- Plan — Design an algorithm before writing code
- Implement — Build the solution
- Test — Dry-run and validate behavior
- Optimize — Analyze time and space complexity
The platform intentionally prevents users from skipping ahead before completing earlier phases.
Each stage is evaluated independently using Google Gemini.
Examples include:
- Comprehension scoring during the Understand phase
- Constraint and edge-case discussions during Clarify
- Algorithm validation during Plan
- Complexity analysis during Optimize
The AI acts as a coaching layer rather than a solution generator.
The interface changes based on the user's current phase.
Discovery Phase (Steps 1–2)
- Conversational workspace
- Problem understanding
- Clarification discussions
- No code editor visible
Execution Phase (Steps 3–6)
- Planning interface
- Monaco code editor
- Testing tools
- Complexity analysis workflow
This encourages users to think before they code.
- Next.js (App Router)
- TypeScript
- Tailwind CSS
- Monaco Editor
- Next.js API Routes
- Prisma ORM
- SQLite
- Google Gemini API
- Custom evaluation prompts
- Step-specific coaching logic
+---------------------------------------+
| Browser (Client) |
| (Tracks session via localStorage UUID)|
+---------------------------------------+
/ | \
/ | \
v v v
+--------------------------------------------------+
| Next.js App Router |
+--------------------------------------------------+
| |
| Problem Pages AI Evaluation API |
| |
+--------------------------------------------------+
| |
v v
+------------------+ +------------------+
| Prisma + SQLite | | Gemini API |
+------------------+ +------------------+
To keep the MVP lightweight, the platform does not require authentication.
Instead:
- A unique session ID is generated in the browser
- Session state is persisted in SQLite
- Progress is restored automatically
- Users can continue where they left off without creating an account
A core requirement was preventing users from skipping directly to implementation.
The application uses a step-based state machine that controls:
- Available UI components
- API evaluation logic
- Database state transitions
- Progress persistence
Each phase must be completed before the next becomes available.
The backend dynamically constructs prompts based on:
- Current interview phase
- Problem context
- Previous user responses
- Session history
This allows the AI coach to provide targeted feedback while maintaining continuity across the entire interview session.
The workspace transitions between conversational and coding environments depending on the user's progress.
This required:
- Centralized session management
- Conditional component orchestration
- Persistent synchronization between client and database state
app/
├── api/
│ ├── ai/
│ └── session/
├── problems/
│ └── [slug]/
components/
├── workspace/
├── StepTracker.tsx
└── TopNav.tsx
context/
└── InterviewContext.tsx
prisma/
├── schema.prisma
├── seed.ts
└── dev.db
git clone https://github.com/iorrah/leetpattern.git
cd leetpatternpnpm installCreate a .env.local file:
DATABASE_URL="file:./prisma/dev.db"
GEMINI_API_KEY=your_api_keynpx prisma db push
npx prisma db seedpnpm devOpen:
http://localhost:3000
Planned enhancements include:
- Voice-based interview practice
- Expanded challenge library
- Interview performance analytics
- Multi-language support
- Real-time collaborative mock interviews
- Adaptive difficulty recommendations
Building LeetPattern reinforced several engineering concepts:
- Designing state-driven user experiences
- Building AI evaluation pipelines
- Managing conversational context across sessions
- Creating dynamic interfaces that evolve with user progress
- Balancing AI assistance without giving away solutions
This project is licensed under the MIT License.









