Top 40 Interview Problems on Arrays

1 Minimum Copy Paste Operations Medium
2 Count and print all Subarrays with product less than K in O(n) Expert
3 Sum of all sub arrays in O(n) Time Expert
4 Sliding Window Algorithm (Track the maximum of each subarray of size k) Expert
5 Divide and Conquer – Rearrange array elements in special order Medium
6 Remove the duplicates from the given String Medium
7 Find median of two sorted arrays of same size Medium
8 Find two non-repeating numbers in an array in O(n) time and O(1) space Expert
9 All elements appears thrice and one element appears once. Find that element in O(n) time and O(1) space Expert
10 Majority Element– Boyer–Moore majority vote algorithm Medium
11 Stock Single Sell Problem — O(n) Solution Expert
12 Maximum Subarray OR Largest Sum Contiguous Subarray Problem – Divide and Conquer Medium
13 Find the two repeating elements in a given array | 6 Approaches Medium
14 Find duplicates in an given array in O(n) time and O(1) extra space Easy
15 Find longest Snake sequence in a given matrix Medium
16 Count all paths in 2D Matrix with Obstructions in it Medium
17 Print All Diagonals of a given matrix Medium
18 Kadane’s Algorithm — Maximum Subarray Problem Medium
19 Shortest Range in K-sorted Lists Expert
20 Generate Maximum revenue by selling K tickets from N windows Medium
21 Merge K Sorted Arrays Expert
22 Rearrange the Array of Given Range N, such that A[i]=i Medium
23 Binary Min — Max Heap Expert
24 Magic Index — Find Index In Sorted Array Such That A[i] = i. Easy
25 Print All the Subsets of a Given Set (Power Set) Expert
26 Track the Maximum Element in a Stack. Medium
27 Print All Possible Valid Combinations Of Parenthesis of Given ‘N’ Expert
28 Counting Sort Medium
29 Check if Array is Consecutive Integers Easy
30 In an Array, find the Smallest Subarray with Sum Greater than the Given Value Easy
31 Rearrange Positive and Negative Elements at Alternate Positions in an Array In O(1) Extra Space Expert
32 Given an array arrA[], find the maximum j – i such that arr[j] > arr[i]. Medium
33 Find All Elements in an Array which appears more than N/K times, N is Array Size and k is a Number. Expert
34 Sorted Array to Binary Search Tree of Minimal Height Medium
35 Print All Paths from Top left to bottom right in Two Dimensional Array Medium
36 Rearrange Positive and Negative Numbers of Array On Each Side in O(nlogn) Expert
37 Find The Longest Sequence Of Prefix Shared By All The Words In A String Expert
38 Print All Elements of Two Dimensional Array in Spiral Medium
39 Merge Sort — Updated — Most Efficient ways to Implement Medium
40 Binary Search Easy