If you only master one data structure before a coding interview, make it the array. Array interview questions open more FAANG phone screens than any other category, and almost every “harder” topic (sorting, binary search, dynamic programming tables, sliding windows) is an array problem underneath. This hub maps the core techniques to the day lessons and blog posts that teach them.

Why Arrays Dominate Interviews

Interviewers reach for array questions for three reasons:

  1. Zero setup cost. No class definitions, no pointer diagrams: you can state “given an array of integers…” and be solving within a minute. That matters in a 45-minute slot.
  2. Smooth difficulty dial. The same problem scales from warm-up to reject-bar: “find the max” becomes “find the max subarray sum” becomes “find the max subarray sum with at most k deletions.”
  3. They expose fundamentals. Off-by-one errors, boundary handling, index arithmetic, and complexity trade-offs all surface immediately. An array question tells an interviewer in ten minutes whether you actually write code regularly.

The practical consequence: array fluency is not one topic among many. It is the substrate the rest of your prep sits on.

Core Techniques to Master

Most medium-difficulty array questions fall to one of four techniques. Learn to recognize the trigger phrases.

Two Pointers

Keep two indices and move them toward each other (or in the same direction at different speeds) instead of checking every pair. Turns O(n²) pair-scanning into O(n).

Trigger phrases: “sorted array,” “pair that sums to,” “remove duplicates in place,” “container with most water.”

Sliding Window

Maintain a window [left, right] over the array and slide it forward, updating a running aggregate instead of recomputing it. The window grows when the constraint is satisfied and shrinks when it breaks.

Trigger phrases: “longest/shortest subarray such that…,” “at most k distinct,” “maximum sum of a window of size k.”

Prefix Sums

Precompute prefix[i] = a[0] + … + a[i-1] once in O(n); afterwards any range sum is prefix[j] - prefix[i] in O(1). Combine with a hash map to count subarrays with a given sum.

Trigger phrases: “sum of elements between indices,” “subarray sum equals k,” “range queries.”

In-Place Manipulation

Rearrange the array without extra memory: reversal tricks for rotations, swap-to-partition for Dutch national flag, index-as-hash for finding missing numbers.

Trigger phrases: “O(1) extra space,” “modify in place,” “without using a second array.”

Beyond these four, two array-adjacent skills are non-negotiable: binary search on sorted (or partially sorted) arrays, and knowing how the standard sorting algorithms behave, because “sort first” is the correct opening move in a huge fraction of problems.

Learn Arrays Day by Day

The 60-day challenge builds array skills across two clusters (fundamentals in week one, searching and sorting in weeks four and five):

If you are starting from zero, do Days 3–6 first, drill two-pointer and sliding-window problems for a week, then come back for Days 25–29.

Complexity Quick Reference

Array operations:

OperationTimeNotes
Access by indexO(1)The array superpower
Search (unsorted)O(n)Linear scan
Search (sorted)O(log n)Binary search
Insert/delete at endO(1) amortizedDynamic arrays
Insert/delete at front or middleO(n)Everything after shifts

Core techniques:

TechniqueTimeSpace
Two pointersO(n)O(1)
Sliding windowO(n)O(1) or O(k)
Prefix sums (build / query)O(n) / O(1)O(n)
Kadane’s max subarrayO(n)O(1)

Sorting:

AlgorithmAverageWorstSpaceStable
QuicksortO(n log n)O(n²)O(log n)No
MergesortO(n log n)O(n log n)O(n)Yes
HeapsortO(n log n)O(n log n)O(1)No
Insertion sortO(n²)O(n²)O(1)Yes

Array Interview Questions by Difficulty

A representative ladder of the array questions FAANG interviewers actually ask, and the technique each one is really testing:

Warm-up (phone screen openers):

  • Two Sum: hash map, or two pointers on sorted input.
  • Best Time to Buy and Sell Stock: one pass, track the running minimum.
  • Remove Duplicates from Sorted Array: slow/fast two pointers, in place.

Medium (the decision round):

  • Maximum Subarray: Kadane’s algorithm; be ready to explain why resetting at negative sums works.
  • Product of Array Except Self: prefix and suffix products without division.
  • Longest Substring Without Repeating Characters: sliding window with a last-seen map.
  • 3Sum: sort, fix one element, two-pointer the rest; the duplicate-skipping is where candidates fail.
  • Subarray Sum Equals K: prefix sums plus a hash map of counts.

Hard (senior loops and final rounds):

  • Trapping Rain Water: two pointers with running maxima, or a monotonic stack.
  • Median of Two Sorted Arrays: binary search on the partition point.
  • Sliding Window Maximum: monotonic deque; the classic “window plus ordering” combination.

Notice the pattern: every hard question is two easy techniques composed. If the medium tier feels automatic, the hard tier is assembly, not invention.

A Simple Practice Plan

  1. Week 1: Days 3–6, plus easy two-pointer problems (reverse array, two-sum on sorted input, remove duplicates).
  2. Week 2: Sliding window and prefix sums, one technique per session, three problems per technique.
  3. Week 3: Days 25–29, then binary-search variants: first/last occurrence, rotated arrays, search on answer.
  4. Ongoing: When a problem stumps you, name which technique it wanted before reading the solution. The naming is the skill.