Intermediate Array Problems for Coding Interviews
585 intermediate Array problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 585 intermediate and 0 advanced. The companies that ask them most often are Google, Amazon, Meta, Microsoft.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Maximum Subarray (Intermediate)
- Product of Array Except Self (Intermediate)
- Rotate Array (Intermediate)
- House Robber (Intermediate)
- Coin Change (Intermediate)
- Kth Largest Element (Intermediate)
- Minimum Size Subarray Sum (Intermediate)
- Longest Consecutive Sequence (Intermediate)
- Subarray Sum Equals K (Intermediate)
- Container With Most Water (Intermediate)
- Jump Game I (Intermediate)
- Next Greater Value (Intermediate)
- Daily Temperatures (Intermediate)
- Minimum Moves to Equal Values (Intermediate)
- Min Cost Climbing Stairs (Intermediate)
- Minimum in a Rotated Sorted Array (Intermediate)
- Peak Index in a Mountain Array (Intermediate)
- Merge Intervals (Intermediate)
- Insert an Interval (Intermediate)
- Longest Run of Ones After One Deletion (Intermediate)
- Best Sightseeing Pair (Intermediate)
- Maximum Units on a Truck (Intermediate)
- Last Stone Weight (Intermediate)
- Maximum Coins From Triples (Intermediate)
- Minimum Time to Make Rope Colorful (Intermediate)
- Hand of Consecutive Groups (Intermediate)
- Sum of Odd-Length Subarrays (Intermediate)
- Count Pairs With a Difference (Intermediate)
- Count Subarrays With K Odd Numbers (Intermediate)
- Subarrays Divisible by K (Intermediate)
- Fruit Into Two Baskets (Intermediate)
- Maximum Points From Cards (Intermediate)
- Shortest Unsorted Middle Part (Intermediate)
- Subarrays With Product Less Than K (Intermediate)
- Longest Mountain Subarray (Intermediate)
- Count Pairs With Sum Below Target (Intermediate)
- Minimum Swaps to Group Ones (Intermediate)
- Binary Subarrays With Target Sum (Intermediate)
- Arithmetic Slices (Intermediate)
- Array Frequency Analysis (Intermediate)
- Prefix Sum Queries (Intermediate)
- Minimum Coin Count With Limited Inventory (Intermediate)
- Longest XOR Subarray (Intermediate)
- Maximum Sum of Distinct Window (Intermediate)
- Circular Next Greater Value (Intermediate)
- Find K Closest Elements (Intermediate)
- K-Partition With Equal Sums (Intermediate)
- Smallest Missing Nonnegative Value (Intermediate)
- Maximum Gap After Sorting (Intermediate)
- Minimum Consecutive Flips (Intermediate)
- Minimum Cost to Paint Houses (Intermediate)
- Maximum Events Attended (Intermediate)
- Minimum Swaps to Make Sequences Increasing (Intermediate)
- Count Subarrays With Fixed Bounds (Intermediate)
- Minimum Operations to Empty Array (Intermediate)
- Rectangle Union Area (Intermediate)
- Count Subsets With Given XOR (Intermediate)
- Count Smaller Values After Each Element (Intermediate)
- Minimum Platforms With Cleanup Time (Intermediate)
- Minimum Time to Complete Trips (Intermediate)
- Maximum Minimum Distance (Intermediate)
- Minimum Value in Bitonic Array (Intermediate)
- Most Competitive Subsequence (Intermediate)
- Shortest Route in Weighted Graph (Intermediate)
- Dependency Build Order (Intermediate)
- Shortest Path With One Free Edge (Intermediate)
- Maximum Bipartite Matching (Intermediate)
- Minimum Height Trees (Intermediate)
- Shortest Path With Alternating Colours (Intermediate)
- Count Complete Components (Intermediate)
- Minimum Edge Reversals Per Node (Intermediate)
- Count Walks With Exact Length (Intermediate)
- Minimum Cost to Connect Network (Intermediate)
- Maximum Score Path in a DAG (Intermediate)
- Maximum Product Subarray (Intermediate)
- Subarray Sum Equals K (Intermediate)
- Coin Change Ways (Intermediate)
- Zero One Knapsack (Intermediate)
- Partition Equal Subset Sum (Intermediate)
- Maximum Circular Subarray (Intermediate)
Related
Frequently asked questions
How do I get good at array problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run array problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.