CodeTutor
Coding interview preparation application with curated questions, educational explanations, and multiple solution approaches.
Features
- Interactive code editor with Python execution in the browser (via Pyodide)
- Run and submit solutions with instant feedback on test cases
- Supports all problem types: simple functions, trees, linked lists, and class-based designs
- Curated collection of coding interview questions
- Detailed explanations with approach, intuition, and complexity analysis
- Common pitfalls and key takeaways for each question
- Multiple solution implementations (optimal and alternative approaches)
- Filter by difficulty, category, and algorithmic pattern
- Links to LeetCode for practice
Tech Stack
- Backend: FastAPI, SQLAlchemy, PostgreSQL, Alembic
- Frontend: Next.js 15, React, TypeScript, Tailwind CSS
- Infrastructure: Docker, Docker Compose
Quick Start
Prerequisites
- Docker and Docker Compose
- Python 3.12+ (for local backend development)
- Node.js 20+ (for local frontend development)
Using Docker (Recommended)
# Set required environment variable
export POSTGRES_PASSWORD=your_secure_password
# Start all services
docker compose up
# Access the application
# Frontend: http://localhost:3000
# API: http://localhost:8000
# API Docs: http://localhost:8000/docs
Local Development
- Start the database:
export POSTGRES_PASSWORD=your_secure_password
docker compose up db
- Set up the backend:
cd backend
cp .env.example .env
# Edit .env with your database credentials
pip install -e ".[dev]"
alembic upgrade head
python scripts/load_data.py
uvicorn src.main:app --reload
- Set up the frontend:
cd frontend
npm install
npm run dev
Project Structure
codetutor/
├── backend/ # FastAPI application
│ ├── src/ # Source code
│ ├── alembic/ # Database migrations
│ ├── data/ # Question content (YAML)
│ ├── scripts/ # Data loading utilities
│ └── tests/ # Backend tests
├── frontend/ # Next.js application
│ └── src/ # Source code
└── docker-compose.yml # Development environment
API Documentation
Once running, access the interactive API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Content
Questions are organised by:
Categories: Arrays, Strings, Hash Tables, Linked Lists, Trees, Graphs, Dynamic Programming, Binary Search, Sorting, Stack, Queue, Heap, Two Pointers, Recursion, Math
Patterns: Two Pointers, Sliding Window, Fast & Slow Pointers, Binary Search, BFS, DFS, Backtracking, Dynamic Programming, Greedy, Monotonic Stack, Heap, Union Find, Trie
License
MIT
Description
Languages
TypeScript
87.7%
Python
11.2%
CSS
0.8%
Dockerfile
0.2%