Arrays & Strings — The Complete MAANG Interview Guide (100 Problems)

Sanjeev SharmaSanjeev Sharma
3 min read

Advertisement

Introduction

Arrays and Strings form the foundation of every technical interview. They appear in every MAANG/FAANG screening round and understanding their core patterns lets you crack 40% of all LeetCode problems.

Why Arrays & Strings Are Critical

  • Frequency: ~35% of all FAANG coding rounds start with an array/string problem
  • Pattern reuse: Prefix sum, two pointers, and sliding window appear across Trees, Graphs, and DP problems too
  • Interview signal: Clean O(n) solutions demonstrate algorithmic maturity

The 7 Core Patterns

PatternProblems It Solves
Prefix SumRange queries, subarray sums
Kadane's AlgorithmMaximum subarray variants
Two PointersPair sums, palindromes, partitioning
Sliding WindowFixed/variable window subarray
Hash Map / SetTwo sum, anagrams, duplicates
Dutch National Flag3-way partition, color sort
In-place TricksXOR, index marking, sign negation

Difficulty Distribution (100 Problems)

  • 🟢 Easy (1–25): Foundation — must solve in < 10 minutes
  • 🟡 Medium (26–75): Core interview level — 20–30 minutes
  • 🔴 Hard (76–100): Senior/Staff bar — 40–45 minutes

Each problem in this series includes:

  1. Problem statement + examples
  2. Intuition walkthrough
  3. Full solutions in C, C++, Java, JavaScript, Python
  4. Time & Space complexity
  5. Edge cases & follow-ups

Roadmap Index

#ProblemDifficultyPattern
1Two Sum🟢HashMap
2Best Time to Buy & Sell Stock🟢Min tracking
3Contains Duplicate🟢HashSet
4Maximum Subarray🟢Kadane
5Move Zeroes🟢Two pointer
6Plus One🟢Carry logic
7Merge Sorted Array🟢3-pointer
8Remove Duplicates from Sorted Array🟢Two pointer
9Single Number🟢XOR
10Intersection of Two Arrays II🟢HashMap
............
76Trapping Rain Water🔴Two ptr / Stack
77Sliding Window Maximum🔴Mono deque
78First Missing Positive🔴Index hash
79Median of Two Sorted Arrays🔴Binary search
80Largest Rectangle in Histogram🔴Mono stack

Start with Problem 1 — Two Sum

Advertisement

Sanjeev Sharma

Written by

Sanjeev Sharma

Full Stack Engineer · E-mopro