Top 50 String Interview Questions
Basic String Manipulation
1. Reverse a string
2. Check palindrome
3. Find length of string (without library)
4. Count vowels & consonants
5. Remove spaces from string
6. Remove duplicate characters
7. Check anagram strings
8. Find frequency of characters
9. Toggle case of string
10. Find first non-repeating character
Pattern Matching & Substrings
11. Implement strstr() / indexOf()
12. Longest common prefix
13. Longest repeating substring
14. Longest palindromic substring
15. Minimum window substring
16. Substring with concatenation of all words
17. Count distinct substrings
18. Rabin-Karp algorithm
19. KMP algorithm
20. Z-algorithm
Sliding Window / Two Pointers
21. Longest substring without repeating characters
22. Longest substring with at most K distinct characters
23. Longest repeating character replacement
24. Check permutation in string (Sliding Window)
25. Smallest substring containing another string
Advanced (Hashing / Stack / DP)
26. Valid parentheses
27. Decode string at index
28. Generate all permutations of string
29. Print all subsequences
30. Group anagrams
31. Longest common subsequence (DP)
32. Edit distance (Levenshtein distance)
33. Wildcard pattern matching
34. Regular expression matching
35. Word break problem
Interview Classics
36. Roman to Integer & Integer to Roman
37. Atoi (string to integer)
38. Implement strstr()
39. Multiply two large numbers (as strings)
40. Longest prefix suffix (LPS - KMP)
41. Shortest palindrome
42. Remove all adjacent duplicates
43. Check if two strings are rotations
44. Print all valid IP addresses
45. Count number of palindromic substrings
Tricky / Hard
46. Encode and Decode strings (LeetCode 271)
47. Serialize and Deserialize string array
48. Find smallest window to make two strings anagram
49. Minimum insertions to make string palindrome
50. Word Ladder (string + graph BFS)