60 Array Practice Questions
Basic Level (20 Questions)
1 Find sum of all elements
2 Find maximum element
3 Find minimum element
4 Count even numbers
5 Count odd numbers
6 Reverse an array
7 Check if array is sorted
8 Find second largest element
9 Print elements at even index
10 Print elements at odd index
11 Find average of array
12 Count frequency of a given number
13 Replace negative numbers with 0
14 Find difference between max and min
15 Copy one array into another
16 Count positive & negative numbers
17 Rotate array left by 1
18 Rotate array right by 1
19 Find largest among first 3 elements
20 Swap first and last element
Easy Level (20 Questions)
1 Two Sum (boolean version)
2 Remove duplicates from sorted array
3 Move zeros to end
4 Find missing number (1 to n)
5 Find duplicate number
6 Best time to buy and sell stock
7 Find all pairs with given sum
8 Intersection of two arrays
9 Union of two arrays
10 Running sum / prefix sum
11 Majority element (> n/2 times)
12 Find element that appears once
13 Check if array is palindrome
14 Rearrange positive and negative numbers
15 Find first repeating element
16 Sort array of 0s, 1s, 2s
17 Check if array contains duplicate
18 Find subarray with given sum (positive numbers)
19 Longest consecutive sequence (basic approach)
20 Left rotate by k places
Medium Level (20 Questions)
1 Subarray sum equals K
2 Longest subarray with sum K
3 Kadane’s Algorithm (Maximum subarray sum)
4 Product of array except self
5 Next permutation
6 Merge intervals
7 Container with most water
8 3Sum problem
9 4Sum problem
10 Maximum product subarray
11 Trapping rain water
12 Find pivot index
13 Longest increasing subsequence (basic DP)
14 Count inversions
15 Find all duplicates in array
16 Rotate matrix 90 degrees
17 Spiral matrix
18 Set matrix zeroes
19 Minimum size subarray sum
20 Maximum consecutive ones (with flipping allowed)