DSA · INTERVIEW & OA PREP

Topic 1 of 12

Arrays & Strings

The most common OA and first-round topic — most warm-up problems are array or string manipulation. Master in-place traversal, prefix sums, and sliding windows here and a large share of easy/medium questions become routine.

Key concepts

  • Two-pointer technique for pairs, reversals, and partitioning in O(n).
  • Sliding window for subarray/substring problems (max sum, longest without repeats).
  • Prefix sums to answer range-sum queries in O(1) after O(n) setup.
  • Strings are arrays of characters — watch for immutability in Java/Python.

Questions that get asked

  • Reverse a string / array in place.
  • Two-sum: find a pair that adds to a target.
  • Longest substring without repeating characters.
  • Maximum subarray sum (Kadane's algorithm).
  • Move all zeros to the end while keeping order.
Tip

State your brute-force first, then optimize out loud — interviewers score your process, not just the final answer.

Common mistake

Off-by-one errors on window/pointer bounds. Dry-run your loop on a 2-3 element example before coding.

Quick checks

Three tap-only questions to test your recall on this topic.

Keep going

Ready to apply? Browse live internships and sharpen your resume first.