A curated collection of Data Structures and Algorithms problems solved in JavaScript, organized by topic and ideal for technical interview preparation.
Each folder corresponds to a DSA topic and contains standalone .js files, one problem per file. Solutions are written for clarity and aim to highlight the underlying pattern (sliding window, two pointers, BFS/DFS, dynamic programming, etc.) rather than micro-optimizations.
| Topic | Folder | Problems |
|---|---|---|
| Arrays | arrays/ |
32 |
| Strings | strings/ |
8 |
| Linked Lists | linked-lists/ |
14 |
| Stacks & Queues | stacks-queues/ |
12 |
| Binary Trees | binary-trees/ |
15 |
| Binary Search Trees | bst/ |
6 |
| Binary Search | binary-search/ |
3 |
| Heap / Priority Queue | heap/ |
4 |
| Graphs | graphs/ |
4 |
| Intervals | intervals/ |
4 |
| Greedy | greedy/ |
4 |
| Backtracking | backtracking/ |
3 |
| Dynamic Programming | dynamic-programming/ |
11 |
| Bit Manipulation | bit-manipulation/ |
4 |
- Node.js (v18 or later recommended)
git clone https://github.com/KadeejaBai/DSAProblems.git
cd DSAProblemsEach file is self-contained. Add a few sample calls at the bottom of the file and run it directly with Node:
node arrays/twoSum.jsThis project uses ESLint. Install dev dependencies and run the linter:
npm install
npx eslint .DSAProblems/
├── arrays/
├── backtracking/
├── binary-search/
├── binary-trees/
├── bit-manipulation/
├── bst/
├── dynamic-programming/
├── graphs/
├── greedy/
├── heap/
├── intervals/
├── linked-lists/
├── stacks-queues/
└── strings/
Contributions are welcome. If you'd like to add a new problem or improve an existing solution:
- Fork the repository.
- Create a new branch (
git checkout -b feat/problem-name). - Add your solution under the appropriate topic folder, using
camelCase.jsnaming consistent with existing files. - Include a brief problem description and complexity analysis as a comment at the top of the file.
- Open a pull request.
This project is licensed under the MIT License.