Talentd
FleetCode
Make and follow sheets.Sign in

Array Problems (2,237)

Problems tagged with Array. Start with the easy ones, then move to medium and hard.

447 Easy1,212 Medium578 Hard

Learn these first

1
Hash Table

Hash tables are frequently combined with arrays to track frequencies, complements, or previously seen values. This approach turns many O(n^2) array problems into O(n) solutions.

2
Prefix Sum

Prefix sums allow constant-time range queries on arrays. This technique is essential for solving subarray sum problems, cumulative counts, and optimization questions.

3
Two Pointers

Many array interview problems use the two-pointer technique to scan from both ends or maintain two moving indices. Learning this pattern helps optimize problems like pair sums, partitioning, and sorted array processing.

4
Binary Search

Binary search is commonly applied to sorted arrays. Understanding this technique helps solve search, boundary, and optimization problems with logarithmic time complexity.

5
Sliding Window

Sliding window builds directly on arrays and helps solve subarray and substring problems efficiently. It reduces nested loops to linear time by maintaining a dynamic window over the array.

TitleSolutionAcceptDifficultyTopics
455. Assign CookiesVideo
Solution55.4%Easy
Array, Greedy +2· 9 companies
456. 132 PatternVideo
Solution35.2%Medium
Array, Binary Search +3· 8 companies
Solution38.3%Medium
Array, Hash Table +1· 4 companies
Solution62.2%Medium
Array, Math +1· 5 companies
Solution74.3%Easy
Array, Breadth-First Search +2· 9 companies
465. Optimal Account BalancingVideoPremium
Solution50.9%Hard
Array, Backtracking +3· 12 companies
469. Convex PolygonVideoPremium
Solution40.3%Medium
Array, Geometry +1· 1 company
Solution49.9%Hard
Array, Depth-First Search +3· 3 companies
Solution42.3%Medium
Array, Backtracking +3· 9 companies
474. Ones and ZeroesVideo
Solution53.7%Medium
Array, Dynamic Programming +1· 5 companies
475. HeatersVideo
Solution42.9%Medium
Array, Binary Search +2· 12 companies
Solution55.3%Medium
Array, Bit Manipulation +1· 3 companies
Solution38.7%Hard
Array, Hash Table +2· 11 companies
484. Find PermutationVideoPremium
Solution67.0%Medium
Array, Greedy +2· 1 company
Solution66.0%Easy
Array· 14 companies
Solution59.7%Medium
Array, Dynamic Programming +3· 6 companies
487. Max Consecutive Ones IIVideoPremium
Solution52.0%Medium
Array, Dynamic Programming +1· 4 companies
490. The MazeVideoPremium
Solution60.4%Medium
Array, Breadth-First Search +2· 13 companies
Solution63.1%Medium
Array, Backtracking +2· 3 companies
493. Reverse PairsVideo
Solution35.1%Hard
Array, Binary Indexed Tree +5· 9 companies
494. Target SumVideo
Solution52.6%Medium
Array, Backtracking +1· 10 companies
495. Teemo AttackingVideo
Solution58.2%Easy
Array, Simulation· 5 companies
Solution76.5%Easy
Array, Hash Table +2· 17 companies
Solution67.1%Medium
Array, Matrix +1· 12 companies
499. The Maze IIIVideoPremium
Solution52.3%Hard
Array, Breadth-First Search +6· 1 company
500. Keyboard RowVideo
Solution74.3%Easy
Array, Hash Table +1· 4 companies
502. IPOVideo
Solution53.6%Hard
Array, Greedy +2· 9 companies
Solution69.3%Medium
Array, Monotonic Stack +1· 16 companies
505. The Maze IIVideoPremium
Solution55.0%Medium
Array, Breadth-First Search +5· 5 companies
506. Relative RanksVideo
Solution75.1%Easy
Array, Heap (Priority Queue) +1· 4 companies
Solution45.9%Hard
Array, Greedy· 2 companies
518. Coin Change IIVideo
Solution59.1%Medium
Array, Dynamic Programming· 11 companies
Solution45.8%Medium
Array, Hash Table +3· 1 company
Solution31.3%Medium
Array, Hash Table +2· 9 companies
Solution52.2%Medium
Array, Hash Table +1· 16 companies
Solution64.9%Medium
Array, Backtracking +3· 6 companies
527. Word AbbreviationVideoPremium
Solution62.7%Hard
Array, Greedy +3· 4 companies
Solution49.0%Medium
Array, Binary Search +3· 26 companies
529. MinesweeperVideo
Solution68.7%Medium
Array, Breadth-First Search +2· 9 companies
531. Lonely Pixel IVideoPremium
Solution62.3%Medium
Array, Hash Table +1· 1 company
Solution46.3%Medium
Array, Binary Search +3· 8 companies
533. Lonely Pixel IIVideoPremium
Solution48.7%Medium
Array, Hash Table +1· 1 company
Solution62.7%Medium
Array, Math +2· 9 companies
542. 01 MatrixVideo
Solution54.7%Medium
Array, Breadth-First Search +2· 14 companies
546. Remove BoxesVideo
Solution50.0%Hard
Array, Dynamic Programming +1· 12 companies
Solution50.1%Hard
Array, Hash Table +1· 1 company
Solution64.0%Medium
Array, Dynamic Programming +1· 1 company
Showing 201–250 of 2,209

More about Array

An Array is one of the most fundamental data structures in computer science. It stores a collection of elements in contiguous memory locations and allows constant-time access using an index. Because of its simplicity and efficiency, arrays are often the first data structure taught in Data Structures and Algorithms (DSA) and serve as the foundation for solving a huge variety of algorithmic problems.

In coding interviews, array questions are extremely common. Companies like Google, Amazon, Meta, and Microsoft frequently test candidates on array manipulation because these problems reveal how well you understand time complexity, memory usage, and algorithmic thinking. Mastering array techniques helps you solve a wide range of interview questions efficiently and often forms the base for more advanced topics.

Array problems typically revolve around recognizing patterns and applying the right technique. Some of the most common approaches include:

  • Using the two pointer technique to process elements from both ends efficiently (see Two Pointers).
  • Optimizing subarray calculations with Prefix Sum.
  • Maintaining dynamic ranges of elements with Sliding Window.
  • Speeding up lookups using Hash Table techniques.
  • Applying Binary Search on sorted arrays to reduce time complexity from O(n) to O(log n).

You should reach for arrays whenever you need fast indexed access, efficient iteration, or when working with sequences of data such as numbers, characters, or objects. Many advanced problems across dynamic programming, greedy algorithms, and graph preprocessing also rely on arrays as their underlying storage.

FleetCode provides ranging from beginner-friendly exercises to advanced interview-level challenges. By practicing these questions and learning the common patterns, you will build the intuition needed to quickly identify optimal solutions during real coding interviews.

Array: common questions

Are Array and Matrix problems related?

Yes. A matrix is essentially a 2D array, meaning many array techniques still apply. Traversal patterns, prefix sums, and sliding window concepts often extend naturally to matrix-based problems.

What is the best way to learn Array in DSA?

Start by understanding basic operations such as traversal, insertion, and deletion. Then practice pattern-based problems like two pointers, prefix sums, and sliding windows.

Is Array an important topic for FAANG interviews?

Yes, arrays are one of the most frequently tested topics in FAANG-style coding interviews. Many problems involving strings, matrices, and sliding windows are fundamentally array problems. Strong array skills often translate into faster solutions for other algorithm categories.

What are common Array patterns in coding interviews?

The most common array patterns include two pointers, sliding window, prefix sum, hashing with arrays, and binary search on sorted arrays. Recognizing which pattern applies to a problem often reduces complexity from O(n^2) to O(n) or O(log n).

How many Array problems should I solve for interviews?

The key is learning patterns rather than memorizing solutions.

What are the best Array problems for coding interviews?

The best array interview problems focus on core patterns such as two pointers, sliding window, prefix sum, and hashing. Classic examples include Two Sum, Maximum Subarray, Product of Array Except Self, and Subarray Sum Equals K.