DSA
What if I told you that weight training to achieve your dream physique is very similar to practicing
dsa for landing that dream company. Moreover, like you start with lighter weights and increase to
heavier weights , similarly you start with easy problems and move to difficult problems. And like you
have exercises for every body part , similarly you problems for each pattern. And like you have a
specific schedule to help you achieve your dream physique, similarly you have specific problems to
achieve the dream company.
Pattern 1: Sliding Window
Pattern 2: Two Pointer
Pattern 3: Fast & Slow pointers
Pattern 4: Merge Intervals
Pattern 5: Cyclic Sort
Pattern 6: In-place Reversal of a LinkedList
Pattern 7: Tree Breadth First Search
Pattern 8: Depth First Search (DFS)
Pattern 9: Two Heaps
Pattern 10: Subsets
Pattern 11: Modified Binary Search
Pattern 12: Bitwise XOR
Pattern 13: Top 'K' Elements
Pattern 14: K-way merge
Pattern 15: 0/1 Knapsack (Dynamic Programming)
Pattern 16: Topological Sort (Graph)
WEEK 1 : Two Pointers and Fast & Slow pointers
1. Introduction
2. Pair with Target Sum (easy) LeetCode
3. Remove Duplicates (easy) LeetCode LeetCode LeetCode LeetCode LeetCode
4. Squaring a Sorted Array (easy) LeetCode
5. Triplet Sum to Zero (medium) LeetCode
6. Triplet Sum Close to Target (medium) LeetCode
7. Triplets with Smaller Sum (medium) LintCode
8. Subarrays with Product Less than a Target (medium) LeetCode
9. Dutch National Flag Problem (medium) CoderByte
10. Problem Challenge 1: Quadruple Sum to Target (medium) Leetcode
11. Problem Challenge 2: Comparing Strings containing Backspaces (medium) Leetcode
12. Problem Challenge 3: Minimum Window Sort (medium) Leetcode Ideserve
13. Introduction [Link]
14. LinkedList Cycle (easy) Leetcode
15. Start of LinkedList Cycle (medium) Leetcode
16. Happy Number (medium) Leetcode
17. Middle of the LinkedList (easy) Leetcode
18. Problem Challenge 1: Palindrome LinkedList (medium) Leetcode
19. Problem Challenge 2: Rearrange a LinkedList (medium) Leetcode
20. Problem Challenge 3: Cycle in a Circular Array (hard) Leetcode
WEEK 2: Sliding Window and Merge Intervals
1. Introduction
2. Maximum Sum Subarray of Size K (easy)
3. Smallest Subarray with a given sum (easy) [Link]
4. Longest Substring with K Distinct Characters (medium) [Link]
5. Fruits into Baskets (medium) LeetCode
6. No-repeat Substring (hard) LeetCode
7. Longest Substring with Same Letters after Replacement (hard) LeetCode
8. Longest Subarray with Ones after Replacement (hard) LeetCode
9. Problem Challenge 1: Permutation in a String (hard) Leetcode
10. Problem Challenge 2: String Anagrams (hard) Leetcode
11. Problem Challenge 3: Smallest Window containing Substring (hard) Leetcode
12. Problem Challenge 4: Words Concatenation (hard) Leetcode
13. Introduction [Link]
14. Merge Intervals (medium) [Link]
15. Insert Interval (medium) [Link]
16. Intervals Intersection (medium) [Link]
17. Conflicting Appointments (medium) Geeksforgeeks
18. Problem Challenge 1: Minimum Meeting Rooms (hard) Lintcode
19. Problem Challenge 2: Maximum CPU Load (hard) Geeksforgeeks
20. Problem Challenge 3: Employee Free Time (hard) CoderTrain
WEEK 3: Cyclic Sort and In-place reversal of Linked List
1. Introduction [Link]
2. Cyclic Sort (easy) Geeksforgeeks
3. Find the Missing Number (easy) Leetcode
4. Find all Missing Numbers (easy) Leetcode
5. Find the Duplicate Number (easy) Leetcode
6. Find all Duplicate Numbers (easy) Leetcode
7. Problem Challenge 1: Find the Corrupt Pair (easy) TheCodingSimplified
8. Problem Challenge 2: Find the Smallest Missing Positive Number (medium) Leetcode
9. Problem Challenge 3: Find the First K Missing Positive Numbers (hard) TheCodingSimplified
10. Introduction [Link]
11. Reverse a LinkedList (easy) Leetcode
12. Reverse a Sub-list (medium) Leetcode
13. Reverse every K-element Sub-list (medium) Leetcode
14. Problem Challenge 1: Reverse alternating K-element Sub-list (medium) Geeksforgeeks
15. Problem Challenge 2: Rotate a LinkedList (medium) Leetcode
WEEK 4: Hash Maps and Tree : BFS
1. Binary Tree Level Order Traversal (easy) Leetcode
2. Reverse Level Order Traversal (easy) Leetcode
3. Zigzag Traversal (medium) Leetcode
4. Level Averages in a Binary Tree (easy) Leetcode
5. Minimum Depth of a Binary Tree (easy) Leetcode
6. Maximum Depth of a Binary Tree (easy) Leetcode
7. Level Order Successor (easy) Geeksforgeeks
8. Connect Level Order Siblings (medium) Leetcode
9. Problem Challenge 1: Connect All Level Order Siblings (medium) Educative
10. Problem Challenge 2: Right View of a Binary Tree (easy) Leetcode
11. Binary Tree Path Sum (easy) Leetcode
12. All Paths for a Sum (medium) Leetcode
13. Sum of Path Numbers (medium) Leetcode
14. Path With Given Sequence (medium) Geeksforgeeks
15. Count Paths for a Sum (medium) Leetcode
16. Problem Challenge 1: Tree Diameter (medium) Leetcode
17. Problem Challenge 2: Path with Maximum Sum (hard) Leetcode
WEEK 5: Two Heaps and Subsets
1. Find the Median of a Number Stream (medium) Leetcode
2. Sliding Window Median (hard) Leetcode
3. Maximize Capital (hard) Leetcode
4. *Maximum Sum Combinations (medium) InterviewBit
5. Subsets (easy) [Link]
6. Subsets With Duplicates (easy) [Link]
7. Permutations (medium) [Link]
WEEK 6: Modified Binary Search and Bitwise XOR
1. Order-agnostic Binary Search (easy) Geeksforgeeks
2. Ceiling of a Number (medium) Geeksforgeeks-Ceil Geeksforgeeks-Floor
3. Next Letter (medium) Leetcode
4. Number Range (medium) Leetcode
5. Search in a Sorted Infinite Array (medium) Leetcode
6. Minimum Difference Element (medium): Find the floor & ceil take the difference, minimum
would be the ans
7. Bitonic Array Maximum (easy) Geeksforgeeks
8. Problem Challenge 1: Search Bitonic Array (medium) Leetcode
9. Problem Challenge 2: Search in Rotated Array (medium) Leetcode
10. Problem Challenge 3: Rotation Count (medium) Geeksforgeeks
11. *Search a 2D Matrix (medium) Leetcode
12. *Minimum Number of Days to Make m Bouquets (medium) Leetcode
13. *Koko Eating Bananas (medium) Leetcode
14. *Capacity To Ship Packages Within D Days (medium) Leetcode
15. *Median of Two Sorted Arrays (hard) Leetcode
16. Single Number (easy)
17. Two Single Numbers (medium)
18. Complement of Base 10 Number (medium)
19. Problem Challenge 1: Flip and Invert an Image (hard)
WEEK 7: Top K Elements and K-way Merge
1. Top 'K' Numbers (easy) Solution
2. Kth Smallest Number (easy)
3. 'K' Closest Points to the Origin (easy) Leetcode
4. Connect Ropes (easy)
5. Top 'K' Frequent Numbers (medium)
6. Frequency Sort (medium)
7. Kth Largest Number in a Stream (medium) Leetcode
8. Merge K Sorted Lists (medium) Leetcode
9. Kth Smallest Number in M Sorted Lists (Medium) Geeksforgeeks
10. Kth Smallest Number in a Sorted Matrix (Hard) [Link]
WEEK 8: 0/1 Knapsack and Topological Sort
1. 0/1 Knapsack (medium) Geeksforgeeks
2. Equal Subset Sum Partition (medium) Leetcode
3. Subset Sum (medium) Geeksforgeeks
4. Minimum Subset Sum Difference (hard) Geeksforgeeks
5. Topological Sort (medium) Youtube
6. Tasks Scheduling (medium) Leetcode-Similar
7. Tasks Scheduling Order (medium) Leetcode-Similar
8. All Tasks Scheduling Orders (hard) Leetcode-Similar
9. Alien Dictionary (hard) Leetcode
10. Problem Challenge 1: Reconstructing a Sequence (hard) Leetcode
11. Problem Challenge 2: Minimum Height Trees (hard) Leetcode