Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧩 DSA-Decoded

Decode Data Structures & Algorithms β€” one pattern at a time.

A structured, pattern-based roadmap to crack the DSA round at FAANG and any top tech company β€” from Easy β†’ Hard. Every solution is clean, commented, and tagged with its complexity.

Language Patterns Problems PRs Welcome License Maintained

⭐ Star this repo if it helps your prep β€” it keeps you accountable and helps others find it!


🎯 Why this repo?

Most people "grind" 300 random problems and still freeze in interviews. Patterns beat problems. Once you recognize the shape of a problem, the solution writes itself.

This repo is built around 18 core patterns (the NeetCode-style roadmap). Follow the order, and you'll cover ~90% of what interviewers actually ask.

  • βœ… Pattern-first β€” learn the technique, not just the answer
  • βœ… Easy β†’ Hard progression within each topic
  • βœ… Every solution has intuition + time/space complexity
  • βœ… Consistent, readable Java style
  • βœ… A progress tracker so you can mark what's done

πŸ—ΊοΈ The Roadmap

Follow the patterns top to bottom. Each builds on the last.

# Pattern Folder Why it matters
01 Arrays & Hashing 01-arrays-and-hashing The foundation β€” HashMap/HashSet tricks
02 Two Pointers 02-two-pointers Sorted arrays, palindromes, pair-finding
03 Sliding Window 03-sliding-window Subarrays/substrings in O(n)
04 Stack 04-stack Matching, monotonic stacks
05 Binary Search 05-binary-search Search space reduction
06 Linked List 06-linked-list Pointers, cycles, reversal
07 Trees 07-trees DFS/BFS, BST properties
08 Tries 08-tries Prefix trees, autocomplete
09 Heap / Priority Queue 09-heap-priority-queue Top-K, streaming medians
10 Backtracking 10-backtracking Subsets, permutations, combos
11 Graphs 11-graphs Islands, BFS/DFS, topo sort
12 Advanced Graphs 12-advanced-graphs Dijkstra, Union-Find, MST
13 1-D Dynamic Programming 13-1d-dynamic-programming The classic DP intro
14 2-D Dynamic Programming 14-2d-dynamic-programming Grids, strings, knapsack
15 Greedy 15-greedy Local β†’ global optimum
16 Intervals 16-intervals Merge, overlap, scheduling
17 Math & Geometry 17-math-and-geometry Rotations, number theory
18 Bit Manipulation 18-bit-manipulation XOR tricks, bit counting

πŸ‘‰ Full problem checklist with difficulty tags: ROADMAP.md


πŸ“ Repository Structure

DSA-Decoded/
β”œβ”€β”€ README.md                  ← you are here
β”œβ”€β”€ ROADMAP.md                 ← full 150+ problem checklist
β”œβ”€β”€ SOLUTION_TEMPLATE.java      ← copy this for every new problem
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
└── patterns/
    β”œβ”€β”€ 01-arrays-and-hashing/
    β”‚   β”œβ”€β”€ README.md           ← pattern intuition + problem list
    β”‚   └── TwoSum.java         ← example solution
    β”œβ”€β”€ 02-two-pointers/
    β”‚   └── ...
    └── ... (18 patterns)

Each solution file is self-contained and runnable (public class with a header comment carrying problem link, difficulty, and complexity).


πŸš€ How to use this repo

  1. Pick a pattern from the roadmap (start at 01).
  2. Read the pattern's README.md to understand the technique.
  3. Attempt the problem yourself first (15–30 min).
  4. Compare with the solution here, then re-solve from scratch.
  5. Mark it done in the progress tracker.
  6. Repeat. Consistency > intensity.

▢️ Running a solution

# Compile and run any single file (Java 11+ supports this directly)
java patterns/01-arrays-and-hashing/TwoSum.java

πŸ“Š Progress Tracker

Tip: copy this into your own fork and check boxes as you go.

Pattern Easy Medium Hard Status
Arrays & Hashing ⬜ ⬜ ⬜ πŸ”œ
Two Pointers ⬜ ⬜ ⬜ πŸ”œ
Sliding Window ⬜ ⬜ ⬜ πŸ”œ
Stack ⬜ ⬜ ⬜ πŸ”œ
Binary Search ⬜ ⬜ ⬜ πŸ”œ
Linked List ⬜ ⬜ ⬜ πŸ”œ
Trees ⬜ ⬜ ⬜ πŸ”œ
Tries ⬜ ⬜ ⬜ πŸ”œ
Heap / PQ ⬜ ⬜ ⬜ πŸ”œ
Backtracking ⬜ ⬜ ⬜ πŸ”œ
Graphs ⬜ ⬜ ⬜ πŸ”œ
Advanced Graphs ⬜ ⬜ ⬜ πŸ”œ
1-D DP ⬜ ⬜ ⬜ πŸ”œ
2-D DP ⬜ ⬜ ⬜ πŸ”œ
Greedy ⬜ ⬜ ⬜ πŸ”œ
Intervals ⬜ ⬜ ⬜ πŸ”œ
Math & Geometry ⬜ ⬜ ⬜ πŸ”œ
Bit Manipulation ⬜ ⬜ ⬜ πŸ”œ

Legend: βœ… done Β· 🟑 in progress Β· πŸ”œ not started


🧠 Complexity Cheat Sheet

Big-O Name Example
O(1) Constant HashMap lookup
O(log n) Logarithmic Binary search
O(n) Linear Single loop
O(n log n) Linearithmic Sorting
O(nΒ²) Quadratic Nested loops
O(2ⁿ) Exponential Subsets / brute backtracking

🀝 Contributing

Found a cleaner solution or a typo? PRs welcome! See CONTRIBUTING.md.

πŸ“œ License

MIT β€” free to use, learn, and share.


If this repo helped you, drop a ⭐ and share it with someone grinding for interviews.

Happy decoding! πŸš€

About

DSA interview prep in Java πŸš€ | LeetCode patterns, FAANG coding-round roadmap, 150+ problems Easyβ†’Hard with optimal solutions, time/space complexity & study plan.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages