String manipulation, pattern matching, and common algorithms like KMP and Rabin-Karp.
Time
Access: O(1), Search: O(n), Concatenation: O(n)
Space
O(n)
Problems
5 must-do
| # | Problem | Difficulty | Asked At |
|---|---|---|---|
| 1 | Valid Anagram | Easy | Google Amazon Microsoft |
| 2 | Longest Substring Without Repeating Characters | Medium | Amazon Google Meta |
| 3 | Longest Palindromic Substring | Medium | Amazon Microsoft Adobe |
| 4 | Group Anagrams | Medium | Google Amazon Meta |
| 5 | Minimum Window Substring | Hard | Google Meta Uber |
Strings are immutable in Java/Python β concatenation creates new objects
Use StringBuilder in Java for efficient string building
Character frequency arrays (size 26) are faster than HashMaps for lowercase English
KMP algorithm achieves O(n+m) pattern matching vs O(n*m) brute force