Automating the practice of data structures and algorithms with Python
April 2025 - Present • 2 months
Personal Project
Ongoing
2 months
Python, Jupyter Notebook, Git
The Automated DSA Questions Tracker is a tool I developed to streamline the process of practicing data structures and algorithms problems. It helps track progress through the NeetCode 150, a curated list of essential coding interview questions, by automating the fetching, organizing, and validating of solutions.
As a technology professional continually honing my skills, I recognized several pain points in the traditional approach to practicing DSA problems that could be improved through automation:
I selected technologies that would provide flexibility, ease of use, and strong ecosystem support:
The project is organized with a clean, modular architecture that separates concerns and makes it easy to maintain and extend:
Automated-DSA/ ├── questions/ # Solutions organized by category/difficulty ├── questions.csv # CSV with all questions & tracking info ├── src/ # Source code │ ├── main.py # Main script to run the workflow │ ├── scrapers/ # Scripts to fetch questions │ ├── templates/ # Solution templates │ └── utils/ # Utility functions ├── requirements.txt # Python dependencies └── README.md # Documentation
Automatically scrapes NeetCode 150 questions and metadata, organizing them by category and difficulty.
Creates templated Python files with problem descriptions, constraints, and solution scaffold.
Maintains a CSV database of questions with completion status, attempt counts, and notes.
Automatically tests solutions against sample cases and custom test cases to verify correctness.
The system obtains questions from NeetCode 150 through web scraping. Each question is processed to extract:
This data is then saved to a CSV file that serves as the central database for the system, allowing easy filtering, sorting, and tracking of progress.
Solutions are organized in a structured directory hierarchy based on category and difficulty:
questions/ ├── arrays_hashing/ │ ├── easy/ │ │ ├── contains_duplicate.py │ │ ├── valid_anagram.py │ │ └── ... │ ├── medium/ │ │ └── ... │ └── hard/ │ └── ... ├── two_pointers/ │ └── ... └── ...
This organization makes it easy to focus on specific categories or difficulty levels during practice sessions.
When a new question is selected for solving, the system generates a Python file with:
""" Contains Duplicate Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3,4,3,2,4,2] Output: true Constraints: 1 <= nums.length <= 10^5 -10^9 <= nums[i] <= 10^9 """ from typing import List def contains_duplicate(nums: List[int]) -> bool: # TODO: Implement your solution here pass # Test cases test_cases = [ ([1,2,3,1], True), ([1,2,3,4], False), ([1,1,1,3,3,4,3,2,4,2], True) ] for i, (nums, expected) in enumerate(test_cases): result = contains_duplicate(nums) print(f"Test {i+1}: {'PASS' if result == expected else 'FAIL'}")
When a new question is selected for solving, the system generates a Python file with:
def contains_duplicate(nums: List[int]) -> bool: # Using a hash set for O(n) time complexity seen = set() for num in nums: if num in seen: return True seen.add(num) return False
The system provides multiple levels of solution validation:
A key feature of the system is its Git integration, which automatically:
The following example demonstrates a typical workflow using the Automated DSA Questions Tracker:
$ python -m main --fetch
This command fetches all NeetCode 150 questions and creates the questions.csv file with metadata.
$ python -m main --new --category "Arrays & Hashing" --difficulty Easy
This generates a new solution file for an easy Arrays & Hashing problem that hasn't been completed yet.
The developer opens the generated file and implements their solution to the problem.
def contains_duplicate(nums: List[int]) -> bool: # Using a hash set for O(n) time complexity seen = set() for num in nums: if num in seen: return True seen.add(num) return False
$ python -m main --test questions/arrays_hashing/easy/contains_duplicate.py
This runs the solution against test cases and verifies correctness and performance.
$ python -m main --commit
This automatically commits the new solution to Git and updates the questions.csv file to mark the problem as completed.
Reduction in time spent on setup and organization
Consistent structure across all solutions
Increase in number of problems solved per practice session
Better coverage of different problem categories
While the current implementation provides significant value, several enhancements are planned for future iterations:
The Automated DSA Questions Tracker demonstrates how automation can significantly enhance the learning and practice experience for data structures and algorithms. By removing the friction from routine tasks like organization, validation, and progress tracking, it allows practitioners to focus more deeply on problem-solving skills and algorithm design.
This project showcases not only technical skills in Python and automation but also a methodical approach to learning and skill development. The system's architecture emphasizes modularity, maintainability, and extensibility—principles that apply broadly across software engineering.
As technical interviews continue to emphasize algorithmic problem-solving abilities, tools like this can provide a competitive advantage through more efficient and comprehensive preparation. The project continues to evolve with new features and improvements based on ongoing usage and feedback.
I can help your organization build custom automation solutions to improve productivity and streamline workflows.