Data Structures & Algorithms
DSA knowledge is tested in coding interviews alongside system design and language depth. Understanding time and space complexity, knowing which data structure to reach for in a given scenario, and being able to implement common algorithms in Java are skills that distinguish candidates at competitive companies.
What You'll Find Here
Notes are being added. Planned topics:
| Topic | Description |
|---|---|
| Complexity Analysis | Big-O notation; time vs. space trade-offs; amortized analysis. |
| Arrays & Strings | Two-pointer, sliding window, prefix sums — core array techniques. |
| Linked Lists | Singly/doubly linked; fast-slow pointer; reverse; detect cycle. |
| Stacks & Queues | Deque as stack/queue; monotonic stack pattern. |
| Trees & BST | Binary tree traversals (DFS/BFS); BST operations; balanced trees. |
| Heaps & Priority Queue | Min-heap, PriorityQueue<> in Java; k-th largest, merge k sorted. |
| Hash Maps & Sets | Hash collision; open addressing vs. chaining; frequency counting. |
| Graphs | BFS, DFS, topological sort, Dijkstra, union-find. |
| Sorting Algorithms | QuickSort, MergeSort, HeapSort; Arrays.sort (TimSort); stability. |
| Dynamic Programming | Memoization vs. tabulation; classic problems (LCS, 0/1 knapsack, coin change). |
Learning Path
- Complexity Analysis — you can't discuss solutions without understanding time/space trade-offs.
- Arrays & Strings — two-pointer and sliding window patterns cover 30%+ of coding interview problems.
- Hash Maps & Sets — constant-time lookup unlocks optimal solutions for frequency and grouping problems.
- Trees — BFS/DFS traversal is tested in both tree and graph problems.
- Dynamic Programming — the hardest category; start with memoization before tabulation.
Related Domains
- Collections Framework — Java's
ArrayList,HashMap,PriorityQueue, andArrayDequeimplement these data structures. - Functional Programming — streams offer declarative alternatives to imperative algorithms.
- System Design — algorithm choice affects system-level performance and scalability.