Metadata-Version: 2.4
Name: interviewprep
Version: 0.1.0
Summary: CLI tool that analyzes Python interview solutions
Author: Yaswanth
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 🚀 InterviewPrep

![Python](https://img.shields.io/badge/Python-3.13-blue)
![License](https://img.shields.io/badge/License-MIT-green)
![Status](https://img.shields.io/badge/Status-Active-success)
![Tests](https://img.shields.io/badge/Tests-Passing-brightgreen)

InterviewPrep is a lightweight Python CLI tool that analyzes Python interview solutions using Python's Abstract Syntax Tree (AST).

Instead of simply running code, InterviewPrep understands the coding technique used and provides an interview-oriented report including:

- Detected Algorithm
- Estimated Time Complexity
- Estimated Space Complexity
- Coding Pattern
- Related LeetCode Problems
- Interview Questions

The goal of this project is to help students understand **why** a solution works instead of only checking whether it is correct.

---

# ✨ Features

Currently InterviewPrep supports automatic detection of:

- ✅ HashMap
- ✅ Set
- ✅ Binary Search
- ✅ Recursion
- ✅ Sliding Window
- ✅ Two Pointers
- ✅ Prefix Sum
- ✅ Breadth First Search (BFS)
- ✅ Depth First Search (DFS)
- ✅ Dynamic Programming

It also provides:

- AST Based Code Analysis
- Pattern Detection
- Time Complexity Estimation
- Space Complexity Estimation
- Related Interview Problems
- Interview Questions
- Beginner Friendly CLI

---

# 📂 Project Structure

```
InterviewPrep/

│── interviewprep/
│   ├── __init__.py
│   ├── __main__.py
│   ├── analyzer.py
│   ├── cli.py
│   ├── detector.py
│   ├── complexity.py
│   ├── pattern.py
│   ├── report.py
│   └── knowledge/
│       ├── hashmap.json
│       ├── set.json
│       ├── binary_search.json
│       ├── recursion.json
│       ├── sliding_window.json
│       ├── two_pointers.json
│       ├── prefix_sum.json
│       ├── bfs.json
│       ├── dfs.json
│       └── dynamic_programming.json
│
│── examples/
│
│── tests/
│
│── README.md
│── LICENSE
│── pyproject.toml
│── requirements.txt
```

---

# ⚙️ Installation

Clone the repository

```bash
git clone https://github.com/doddiyaswanth/InterviewPrep.git
```

Move into the project

```bash
cd InterviewPrep
```

Install the package

```bash
pip install -e .
```

---

# ▶️ Usage

Analyze a Python solution

```bash
python -m interviewprep examples/twosum.py
```

Another example

```bash
python -m interviewprep examples/two_pointers.py
```

You can analyze any Python solution file.

Example:

```bash
python -m interviewprep my_solution.py
```

---

# 💻 Sample Output

```text
========================================
InterviewPrep Report
========================================

For Loops : 1
While Loops : 0

Detected Topics

✔ HashMap

Estimated Time Complexity

O(n)

Estimated Space Complexity

O(n)

Related Problems

• Contains Duplicate
• Top K Frequent Elements
• Group Anagrams

Interview Questions

1. Why did you choose a HashMap?
2. Can you solve this without extra space?
3. Why is lookup O(1)?

Detected Patterns

✔ Single Pass

Estimated Overall Time Complexity

O(n)
========================================
```

---
# 🧪 Running Tests

Run all tests

```bash
pytest
```

Expected Output

```text
==========================
10 passed in 0.05s
==========================
```

---

# 📚 Supported Algorithms

| Algorithm | Supported |
|-----------|-----------|
| HashMap | ✅ |
| Set | ✅ |
| Binary Search | ✅ |
| Recursion | ✅ |
| Sliding Window | ✅ |
| Two Pointers | ✅ |
| Prefix Sum | ✅ |
| BFS | ✅ |
| DFS | ✅ |
| Dynamic Programming | ✅ |

---

# 🏗️ How It Works

InterviewPrep uses Python's **AST (Abstract Syntax Tree)** to analyze source code.

Workflow:

```
Python File
      │
      ▼
 AST Parser
      │
      ▼
 Topic Detector
      │
      ▼
 Pattern Detector
      │
      ▼
 Complexity Estimator
      │
      ▼
 Knowledge Base
      │
      ▼
 Interview Report
```

---

# 🗺️ Roadmap

### Version 1.0
- CLI Tool
- AST Analysis
- 10 DSA Topic Detection
- Complexity Estimation
- Pattern Detection
- JSON Knowledge Base

### Future Versions
- More DSA Topics
- HTML Report
- PDF Report
- Directory Analysis
- Better Complexity Estimation
- PyPI Package

---

# 🤝 Contributing

Contributions are welcome.

1. Fork the repository.
2. Create a new branch.
3. Commit your changes.
4. Open a Pull Request.

---

# 📄 License

This project is licensed under the MIT License.

---

# 👨‍💻 Author

**Doddi Yaswanth**

- GitHub: https://github.com/doddiyaswanth

---

⭐ If you like this project, consider giving it a star on GitHub.
