Arrays and strings
Arrays
Array is a fixed or dynamic collection of values stored in index order.
Important questions
- Two Sum
- Best Time to Buy and Sell Stock
- Contains Duplicate
- Product of Array Except Self
- Maximum Subarray
- Merge Intervals
- Rotate Array
- Move Zeroes
String patterns
- Valid Palindrome
- Longest Substring Without Repeating Characters
- Group Anagrams
- String Anagram Check
- Reverse Words in a String
- Longest Common Prefix
Common patterns
- Two pointers
- Sliding window
- Prefix/suffix sums
- Hash map for frequency
Example interview answer
“Since we need to check matches efficiently, I would use a hash map to count frequencies and compare. This reduces repeated scanning and gives O(n) time.”
Can you explain it without the notes?
Arrays and strings
Use your own words. Explain an example and one limitation before checking the explanation.
Check your explanation
Arrays
Turn this concept into a clear answer.
Practice this conceptAdapted from 14_DSA_MASTER.md · “3. Arrays and strings”. Examples are study fragments; framework behavior can depend on your version.