Python Systems Interview Lab
A production-grade Python interview practice platform with 82 problems focused on real-world Python skills, not algorithms.
๐ฏ What Makes This Different
Not another LeetCode clone. This platform focuses on:
- โ Python-specific features (Type Hints, Decorators, Context Managers)
- โ Standard library mastery (functools, itertools, collections)
- โ Production patterns (Pydantic, pytest, async/await)
- โ Real-world scenarios (log parsing, config validation, API rate limiting)
No algorithm grinding. Use LeetCode for that. This is for Python mastery.
๐ Quick Start
Run the Platform
Easy way (recommended):
./scripts/dev.sh
# Automatically starts both backend and frontend
# Open http://localhost:5173Manual way (two terminals):
# Terminal 1: Start backend
cd server
uvicorn main:app --reload
# Terminal 2: Start frontend
cd ui
npm run dev
# Open http://localhost:5173Try a Problem
- Click any problem in the sidebar
- Write your solution in the Monaco editor
- Run tests to get instant feedback
- Get hints for failing tests
- Move to the next problem
๐ Current Problems (82)
Categories Include
- Functools - partial, lru_cache, singledispatch, reduce
- Itertools - groupby, combinations, chain, accumulate
- Generators & Coroutines - yield, send, async patterns
- Type Hints - TypedDict, Protocols, Generics
- Decorators - retry logic, memoization, validation
- Testing - pytest fixtures, mocking, parametrize
- Collections - Counter, defaultdict, ChainMap
- Context Managers - custom contexts, contextlib
- Async/Await - asyncio, concurrent patterns
- File I/O - JSON/CSV parsing, log processing
- Pattern Matching - structural pattern matching
- ABC & Enums - abstract base classes, enumerations
- And more...
โจ Features
๐ Advanced Filtering
- Search by problem name
- Filter by difficulty (Easy, Medium, Hard)
- Filter by categories (multiple selection)
- Real-time filter updates
๐ Rich Editor
- Monaco Editor (VS Code editor)
- Python syntax highlighting
- Auto-completion
- Minimap navigation
โ Comprehensive Testing
- Public tests (visible before solving)
- Hidden tests (revealed after passing)
- Detailed error messages
- Helpful hints for debugging
๐จ Modern UI
- Dark theme optimized for coding
- Syntax highlighting for example code blocks
- Clickable category badges for quick filtering
- Semantic markdown headers for better structure
- Resizable editor/problem panels
- Progress tracking with URL-based state
๐ Documentation
For Users
- docs/ADDING_PROBLEMS.md - Complete guide to adding problems
- docs/PROBLEM_TEMPLATE.py - Copy-paste template
- docs/CATEGORIES.md - Category reference
For Contributors
See documentation above for:
- Problem structure and patterns
- Category guidelines
- Test case best practices
- Using Claude/Codex to generate problems
๐ ๏ธ Tech Stack
Backend
- FastAPI - Modern Python web framework
- Python 3.11+ - Type hints, pattern matching
- uvicorn - ASGI server
Frontend
- React + TypeScript
- Vite - Fast builds
- Monaco Editor - VS Code editor component
๐ Roadmap
Current: 82 problems โ
Goal: 100+ problems
Completed Categories โ
- Functools (partial, lru_cache, singledispatch)
- Itertools (groupby, combinations, chain)
- Generators & Coroutines
- pytest fixtures & mocking
- Type hints & Protocols
- Pattern matching
- ABC & Enums
Future Additions
- Pydantic advanced validation
- More async/await patterns
- subprocess management
- Regular expressions
- Dataclasses advanced features
How to Add Problems
Option 1: Ask Claude (me!)
I need 10 problems for [categories].
See docs/ADDING_PROBLEMS.md for structure.
Generate complete Python code for python_advanced_problems.py
Option 2: Use Codex/Copilot
# Open problems/python_advanced_problems.py
# Add comment describing what you want
# Let Copilot generate the code
# Review and adjustOption 3: Manual
- Copy
docs/PROBLEM_TEMPLATE.py - Fill in placeholders
- Add to
problems/python_advanced_problems.py - Update
NEW_PROBLEMSlist - Test in UI
๐ Problem Categories
Core Python (Use These!)
Type System: Type Hints, TypedDict, Protocols, Generics, Literal, Union Types
Decorators: Decorators, functools, Closures
Context: Context Managers, contextlib
Collections: Counter, defaultdict, deque, ChainMap, namedtuple
Iteration: Generators, Iterators, itertools, Comprehensions
Validation: Pydantic, Data Classes
Async: Async/Await, asyncio, Threading, concurrent.futures
I/O: File I/O, pathlib, JSON, CSV, Logging
Testing: pytest, Mocking, Fixtures
Other: Error Handling, Datetime, Regular Expressions, subprocess
โ Avoid (Use LeetCode)
Algorithms, Graph Algorithms, Binary Search, Dynamic Programming, etc.
๐ค Contributing Problems
- Read the docs - See ADDING_PROBLEMS.md
- Use the template - Copy PROBLEM_TEMPLATE.py
- Follow categories - Reference CATEGORIES.md
- Test thoroughly - Run in UI before committing
- Focus on Python - Real-world, production-realistic scenarios
Quality Checklist
- Realistic production scenario
- Comprehensive docstring
- 3-4 test cases (at least 1 hidden)
- Helpful hints in failing tests
- Python-specific categories
- Proper difficulty level
- Works in UI
๐ Example Problem
def _build_retry_decorator_problem() -> Problem:
"""Retry decorator with exponential backoff."""
starter_code = (
"from functools import wraps\n\n"
"def retry(max_attempts=3, backoff_factor=2.0):\n"
" \"\"\"Decorator that retries on failure.\"\"\"\n"
" raise NotImplementedError\n"
)
def run_tests(solution_module):
# Test 1: Succeeds first try
# Test 2: Retries and succeeds
# Test 3: Exhausts retries
# Test 4: Exponential backoff timing
...
return Problem(
slug="retry_decorator",
title="Retry Decorator with Exponential Backoff",
difficulty="medium",
description="Network calls fail. Build retry logic...",
categories=["Decorators", "Error Handling", "functools"]
)๐๏ธ Project Structure
interview-prep/
โโโ server/ # FastAPI backend
โ โโโ main.py # API endpoints
โโโ ui/ # React frontend
โ โโโ src/
โ โโโ App.tsx # Main component with filters
โ โโโ api.ts # API client
โโโ problems/ # Problem definitions
โ โโโ problem_bank.py # Core problems
โ โโโ python_advanced_problems.py # New Python problems
โโโ docs/ # Documentation
โ โโโ ADDING_PROBLEMS.md # How to add problems
โ โโโ PROBLEM_TEMPLATE.py # Template
โ โโโ CATEGORIES.md # Category reference
โโโ README.md # This file
๐งช Testing
Backend Tests
cd server
pytestFrontend Tests
cd ui
npm testManual Testing
- Start both servers
- Open http://localhost:5173
- Try solving a problem
- Verify tests run correctly
- Check filtering works
๐ Troubleshooting
Backend won't start
# Check Python version
python3 --version # Need 3.11+
# Install dependencies
pip install -r requirements.txtFrontend won't start
# Check Node version
node --version # Need 16+
# Install dependencies
npm installCategories not showing
# Restart backend - categories are auto-discovered
cd server
uvicorn main:app --reloadProblem not appearing
- Check it's in
NEW_PROBLEMSlist - Restart backend
- Clear browser cache
- Check browser console for errors
๐ก Tips
For Problem Solvers
- Read the full problem description
- Check the function signature carefully
- Use the hints when tests fail
- Test edge cases yourself
- Ask for help if stuck
For Problem Creators
- Focus on production scenarios
- Include realistic data
- Write comprehensive tests
- Provide helpful hints
- Use Python-specific categories
๐ Learning Resources
- Type Hints: PEP 484, mypy docs
- Async: asyncio docs
- Testing: pytest docs
- Pydantic: pydantic docs
- Collections: collections docs
- itertools: itertools docs
๐ฏ Goals
- Build filtering UI (search, categories, difficulty)
- Create 12 high-quality problems
- Write comprehensive documentation
- Reach 25-30 problems
- Add Pydantic problems
- Add async/await problems
- Add pytest/mocking problems
- Reach 100+ problems
๐ Credits
Built with:
- FastAPI - Backend framework
- React - Frontend library
- Monaco Editor - Code editor
- Vite - Build tool
Ready to add problems? Start with docs/ADDING_PROBLEMS.md
Need help? Ask Claude or use the problem template!