The app for independent voices

16 important DSA Problem Patterns you should look at while preparing for coding interviews (with example problems):

1. Sliding Window

- Longest Substring without repeating characters

- Longest Substring with k distinct characters

- Minimum size subarray sum

2 Matrix Traversal

- Number of Islands

- Max Area of Island

- Number of closed islands

3: Intervals

- Merge overlapping intervals

- Insert interval

- Remove interval

4. Two Pointers

- Container with the most water

- Trapping rainwater

- Linked list cycle

5. Slow & Fast Pointers

- Middle of the linked list

- Remove Nth Node From End of List

6. DFS, BFS

- Most of the tree and graph problems

7. Subsets and Substring problems

- Maximum subarray

- Subarray 1,2

8 Bitwise XOR

- XOR queries of subarray

- Neighbouring bitwise xor

9. Picking top/max/min K elements

- Top K frequent elements

10. Modified Binary Search

- Search a 2D matrix

- Kth smallest element in sorted matrix

11. Topological Sort

- Course Schedule

- Longest cycle in the graph

12. 0/1 knapsack

- Equal subset sum partition

13. Palindrome subsequence

- Longest palindromic substring

- Minimum window substring

14. DP: Decision making

- Best Time to Buy and Sell Stock

- House Robber

15. DP: Distinct ways

- Unique Paths

- Target Sum

16 DP: Max - Min

- Minimum Path Sum

- Coin Change

Jan 17
at
3:04 PM
Relevant people

Log in or sign up

Join the most interesting and insightful discussions.