Advanced Array Problems for Coding Interviews
296 advanced Array problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 0 intermediate and 296 advanced. The companies that ask them most often are Google, Amazon, Microsoft, Bloomberg.
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
- Longest Increasing Subsequence (Advanced)
- Count Inversions (Advanced)
- Trapping Rain Water (Advanced)
- Partition Into Equal Halves (Advanced)
- Largest Rectangle in Histogram (Advanced)
- Coin Change Ways (Advanced)
- Target Sum (Advanced)
- Largest Number From Digits (Advanced)
- Search in a Rotated Sorted Array (Advanced)
- Next Arrangement (Advanced)
- Candy Distribution (Advanced)
- Max Chunks to Make Sorted (Advanced)
- Sum of Subarray Minimums (Advanced)
- Maximum Width Ramp (Advanced)
- Maximum Subarray After One Deletion (Advanced)
- Four Lists Sum to Zero (Advanced)
- Count Equal XOR Triplets (Advanced)
- Best Stock Profit With Fee (Advanced)
- Longest Common Contiguous Segment (Advanced)
- Maximum Profit With K Transactions (Advanced)
- Minimum Cost to Merge Stones (Advanced)
- Allocate Books to Students (Advanced)
- Longest Equal Zeros and Ones Subarray (Advanced)
- Maximum Non-Overlapping Target Segments (Advanced)
- Count Shortest Paths (Advanced)
- Maximum Flow Network (Advanced)
- Minimum Cost Assignment (Advanced)
- Minimum Path Cover in a DAG (Advanced)
- Shortest Cycle in Undirected Graph (Advanced)
- Stock With Cooldown (Advanced)
- Largest Divisible Subset Size (Advanced)
- Longest Arithmetic Subsequence (Advanced)
- Network Delay Time (Advanced)
- Maximum Rectangle in Histogram (Advanced)
- Sum of Subarray Minimums (Advanced)
- Triplets Below Threshold (Advanced)
- Previous Smaller Span (Advanced)
- Maximum Subsequence Score (Advanced)
- Minimum Number of Taps (Advanced)
- Maximum XOR Pair Under Limit (Advanced)
- Recurring Event Conflict (Advanced)
- Persistent Range Kth Query (Advanced)
- Weighted Interval Scheduling Reconstruction (Advanced)
- N-ary Tree Diameter (Advanced)
- Longest Subarray With Sum At Most K (Advanced)
- Smallest Range Across K Lists (Advanced)
- Maximum Pair Chain (Advanced)
- Minimum Cost to Make Array Strictly Increasing (Advanced)
- Minimum Cost Tickets (Advanced)
- Minimum Cost to Merge Files (Advanced)
- Randomized Set With Duplicates (Advanced)
- IP Longest Prefix Match (Advanced)
- Message Retry With Dead Letter (Advanced)
- Time Series Gap Detection (Advanced)
- Exact Cover Solver (Advanced)
- Polynomial Multiplication (Advanced)
- Tree Height After Subtree Removal Queries (Advanced)
- Sum of Distances in Tree (Advanced)
- Bridges in a Graph (Advanced)
- Articulation Points (Advanced)
- Jump Game IV (Advanced)
- Shortest Path Visiting All Nodes (Advanced)
- Reachable Nodes in Subdivided Graph (Advanced)
- Second Minimum Arrival Time (Advanced)
- Largest Color Value in a Directed Graph (Advanced)
- Critical and Pseudo-Critical MST Edges (Advanced)
- Number of Restricted Paths (Advanced)
- Immediate Dominators (Advanced)
- Minimum Edges to Make Graph Strongly Connected (Advanced)
- Minimum Vertex Cut (Advanced)
- Burst Balloons (Advanced)
- Minimum Removals to Make Mountain Array (Advanced)
- Profitable Schemes (Advanced)
- Ways to Stay in the Same Place (Advanced)
- Remove Boxes (Advanced)
- Minimum Difficulty of a Job Schedule (Advanced)
- Arithmetic Subsequence Count (Advanced)
- Tallest Billboard (Advanced)
- Three Non-Overlapping Subarrays (Advanced)
- Jump Game V (Advanced)
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.