Top 50 Array Interview Questions
Easy Level
• 1. Find Maximum and Minimum in Array
• 2. Second Largest Element
• 3. Reverse an Array
• 4. Check if Array is Sorted
• 5. Remove Duplicates from Sorted Array
• 6. Move Zeroes to End
• 7. Rotate Array by K Positions
• 8. Find Missing Number (1 to N)
• 9. Find Duplicate Element
• 10. Count Frequency of Each Element
• 11. Two Sum
• 12. Best Time to Buy and Sell Stock
• 13. Intersection of Two Arrays
• 14. Union of Two Arrays
• 15. Maximum Subarray Sum (Kadane’s Algorithm)
Medium Level
• 16. Three Sum
• 17. Four Sum
• 18. Majority Element
• 19. Sort Colors (Dutch National Flag Algorithm)
• 20. Merge Sorted Arrays
• 21. Merge Intervals
• 22. Product of Array Except Self
• 23. Find Peak Element
• 24. Container With Most Water
• 25. Subarray with Given Sum
• 26. Longest Consecutive Sequence
• 27. Next Permutation
• 28. Set Matrix Zeroes
• 29. Spiral Matrix
• 30. Rotate Matrix (90 Degrees)
• 31. Search in Rotated Sorted Array
• 32. Find First and Last Position of Element
• 33. Trapping Rain Water
• 34. Minimum Number of Platforms
• 35. Count Inversions in Array
Advanced Level
• 36. Median of Two Sorted Arrays
• 37. Kth Largest Element
• 38. Sliding Window Maximum
• 39. Maximum Product Subarray
• 40. Subarray Sum Equals K
• 41. Partition Equal Subset Sum
• 42. Longest Increasing Subsequence
• 43. Merge K Sorted Arrays
• 44. Largest Rectangle in Histogram
• 45. Stock Buy and Sell (Multiple Transactions)
• 46. Find Duplicate (Floyd’s Cycle Detection)
• 47. Gas Station Problem
• 48. Chocolate Distribution Problem
• 49. Count Subarrays with XOR K
• 50. Maximum Sum Circular Subarray