Array and string patterns
Master the four most common array patterns.
- DSA.06.01Pattern 1: Two pointersCoreJuniorBeing written
- DSA.06.02Pattern 2: Sliding windowCoreMid-levelBeing written
- DSA.06.03Pattern 3: Prefix sumsCoreMid-levelBeing written
- DSA.06.04Pattern 4: Hashing and countingCoreJuniorBeing written
Interview questions in this module
- When does the two-pointer technique work? Why must the input often be sorted?
- How do you recognise a sliding-window problem?
- Why does the sliding window fail with negative numbers, and what do you use instead?
- Find the number of subarrays whose sum is k in O(n).
- Group anagrams efficiently. What key do you use?