DSA Most Asked Questions – Arrays & Strings
ARRAYS – MUST DO
1. Largest & Smallest element
2. Reverse array
3. Second largest / smallest
4. Check if array is sorted
5. Remove duplicates (sorted)
6. Rotate array by K
7. Move zeros to end
8. Kadane’s Algorithm
9. Missing number (1 to N)
10. Duplicate number
11. Two Sum
12. Merge sorted arrays
13. Majority element
14. Union & Intersection
15. Stock Buy & Sell
ARRAYS – FREQUENTLY ASKED
16. Sort 0s,1s,2s
17. Alternate positive & negative
18. Frequency count
19. Leaders in array
20. Trapping rain water
21. Product except self
22. Maximum consecutive 1s
23. Longest subarray sum
24. Subarray sum = 0
25. Peak element
STRINGS – MUST DO
1. Reverse string
2. Palindrome check
3. Anagram check
4. Count vowels & consonants
5. Remove duplicates
6. First non-repeating char
7. Reverse words
8. String rotation
9. Length of last word
10. Valid parentheses
11. Longest common prefix
12. String compression
13. Atoi (string to int)
14. Only digits check
15. Character occurrences
STRINGS – FREQUENTLY ASKED
16. Longest substring without repeat
17. Longest palindromic substring
18. Remove adjacent duplicates
19. Permutations of string
20. Group anagrams
21. KMP / Pattern matching
22. Pangram check
23. Roman to integer
24. Isomorphic strings
25. Balanced brackets