LESSON 03 / 75·2 min readFoundation

Arrays and strings

Must knowConcept lesson
01 Understand02 Recall03 Prepare

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.”


PAUSE & RECALL

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

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Hashing and maps

Adapted from 14_DSA_MASTER.md · “3. Arrays and strings”. Examples are study fragments; framework behavior can depend on your version.