Medium | Products of ranges in an array | Problem Statement The problem “Products of ranges in an array” states that you are read more |

Easy | Palindrome Permutation | Problem Statement The problem “Palindrome Permutation” states that you are given a read more |

Medium | Sort an array according to the order defined by another array | Problem Statement You are given two arrays of integers arr1[] and arr2[]. The problem “Sort read more |

Easy | Rearrange a binary string as alternate x and y occurrences | Problem Statement Suppose you are given a binary string, and two numbers x and y. The string read more |

Easy | Shuffle 2n integers as a1-b1-a2-b2-a3-b3-..bn without using extra space | Problem Statement You are given an array of integers. The problem “Shuffle 2n integers as read more |

Easy | Distinct adjacent elements in an array | Problem Statement Suppose we have an integer array. The problem “Distinct adjacent elements read more |

Medium | Construction of Longest Increasing Subsequence (N log N) | Problem Statement You are given an array of integers. The problem “Construction of Longest read more |

Easy | Maximize sum of consecutive differences in a circular array | Problem Statement Suppose you have an integer array. This array should be treated as a circular read more |

Easy | Three way partitioning of an array around a given range | Problem Statement You are given an array of integers and a range of lowValue and highValue. The read more |

Easy | Check if X can give change to every person in the Queue | Problem Statement X is an ice cream seller and there are n people waiting in a queue to buy an ice read more |

Easy | Rearrange an array such that ‘arr[j]’ becomes ‘i’ if ‘arr[i]’ is ‘j’ | Problem Statement The problem ” Rearrange an array such that ‘arr[j]’ becomes ‘i’ if read more |

Easy | Maximum length subsequence with difference between adjacent elements as either 0 or 1 | Problem Statement You are given an integer array. The problem “Maximum length subsequence read more |

Easy | Replace two consecutive equal values with one greater | Problem Statement Suppose you have an integer array. The problem “Replace two consecutive read more |

Easy | Find a sorted subsequence of size 3 in linear time | Problem Statement The problem “Find a sorted subsequence of size 3 in linear time” read more |

Easy | Maximum Product Subarray | Problem Statement The problem “Maximum Product Subarray” states that you are given an read more |

Easy | Convert array into Zig-Zag fashion | Problem Statement The problem “Convert array into Zig-Zag fashion” states that you are read more |

Easy | Rearrange array such that even index elements are smaller and odd index elements are greater | Problem Statement You have given an array of integers. The problem “Rearrange array such that read more |

Easy | Segregate even and odd numbers | Problem Statement Suppose you have an integer array. The problem “Segregate even and odd read more |

Medium | Find Minimum In Rotated Sorted Array | Problem Statement “Find Minimum In Rotated Sorted Array” states that you are given a read more |

Easy | Move all negative elements to end in order with extra space allowed | Problem Statement “Move all negative elements to end in order with extra space allowed” read more |

Easy | Rearrange array such that even positioned are greater than odd | Problem Statement Suppose you have an integer array. The problem “Rearrange array such that read more |

Easy | Double the first element and move zero to end | Problem Statement Suppose you have an array of integers. Here “0” is not a number which is read more |

Easy | Remove duplicates from sorted array | Problem Statement “Remove duplicates from sorted array” states that you are given a read more |

Easy | Product of array except self | Problem Statement “Product of array except self” problem, states that you are given an read more |

Medium | First missing positive | Problem Statement “First missing positive” problem states that you are given an array read more |

Medium | Contiguous Array Leetcode | Problem Statement “Contiguous Array Leetcode” problem states that you are given an read more |

Easy | Find the minimum distance between two numbers | Problem Statement You have given an array and two numbers called x and y. The problem “Find read more |

Medium | Count pairs from two sorted arrays whose sum is equal to a given value x | Problem Statement “Count pairs from two sorted arrays whose sum is equal to a given value read more |

Easy | Find the subarray with least average | Problem Statement You have given an integer array and a number k. The problem statement asks to read more |

Medium | Find the smallest positive integer value that cannot be represented as sum of any subset of a given array | Problem Statement You are given a sorted array of integers. We need to find the smallest positive read more |

Easy | Find minimum number of merge operations to make an array palindrome | Problem Statement You are given an array of integers. The problem statement asks to find minimum read more |

Medium | Minimize the maximum difference between the heights | Problem Statement You are given some heights of n towers and a number k. We can either increase the read more |

Easy | Find maximum average subarray of k length | Problem Statement You are given an array of integers and a number k. The problem statement asks to read more |

Easy | Find minimum difference between any two elements | Problem Statement You are given an array of integers. The problem statement asks to find minimum read more |

Easy | Count minimum steps to get the given desired array | Problem Statement Suppose you have an array containing only integer 0 as all of its elements. read more |

Subset Leetcode | In Subset Leetcode problem we have given a set of distinct integers, nums, print all subsets (the read more | |

Dividing Array into Pairs With Sum Divisible by K | The dividing array into pairs with sum divisible by K is a problem which is asked in interviews read more | |

Count Distinct Elements in Every Window of Size K | Subsets are something which we have been dealing with for some time now. In the last episode, we read more | |

Count Subsets Having Distinct Even Numbers | We have all struggled with the subset problem at some point or the other in an interview. The read more | |

Find Three Element From Different Three Arrays Such That a + b + c = sum | Three Sum is a problem loved by interviewers. It is a problem I was personally asked during the read more | |

Longest Increasing Subsequence | We are provided with an array of integers that is unsorted and we have to find the longest read more | |

Count Pairs Whose Products Exist in Array | In count pairs whose products exist in array problem we have given an array, count all the distinct read more | |

Merge Overlapping Intervals | In merge overlapping intervals problem we have given a collection of intervals, merge and return read more | |

Median of Two Sorted Arrays | Given two sorted arrays A and B of size n and m respectively. Find the median of the final sorted read more | |

Maximum Product Subarray | In the maximum product subarray problem, we have given an array of integers, find the contiguous read more | |

Find Maximum of Minimum for Every Window Size in a Given Array | Given an array a[ ] of size n. For every window size that varies from 1 to n in array print or find read more | |

Minimum Size Subarray Sum | Given an array nums of a positive integer and a sum s, find the minimum size of a contiguous read more | |

Intersection of Two Arrays | In intersection of two arrays problem, we have given two arrays, we need to print their read more | |

Leetcode Permutations | In this leetcode problem premutation we have given an array of distinct integers, print all of its read more | |

Search an Element in Sorted Rotated Array | In search in sorted rotated array problem we have given a sorted and rotated array and an element, read more | |

Maximum Product Subarray | Given an array of n integers, find the maximum product obtained from a contiguous subarray of the read more | |

3 Sum | In 3 Sum problem, we have given an array nums of n integers, find all the unique triplets that sum read more | |

Find The Duplicate Number | Given an array nums containing (n + 1) elements and every element is between 1 to n. If there is read more | |

Maximum Sum of 3 Non-Overlapping Subarrays | In the maximum sum of 3 non-overlapping subarrays problem we have given an array nums of positive read more | |

Minimum Index Sum of Two Lists | Ankur and Rishabh are two friends and want to buy some fruits from the market. They both have a read more | |

Split Array Into Consecutive Subsequences | Given a sorted array(in ascending order), check if the array can be split into 1 or more read more | |

Find the Duplicate Element | Given an array of integers of size n+1 where each element of the array is between 1 and n read more | |

Find the Only Repetitive Element Between 1 to N-1 | In finding the only repetitive element between 1 to N-1 problem we have given an array of random read more | |

Trapping Rain Water | In Trapping Rain Water problem we have given N non-negative integers representing an elevation map read more | |

Finding K closest element | In Finding K closest element problem we have given a sorted array and a value x. The problem is to read more | |

Jump Game | In jump game we have given an array of non-negative integers, you are initially positioned at the read more | |

Combination Sum | In combination sum problem we have given an array of positive integers arr[] and a sum s, find all read more | |

Search in Sorted Rotated Array | An element search in sorted rotated array can be found using binary search in O(logn) time. The read more | |

Maximum Subarray | In the Maximum Subarray problem we have given an integer array nums, find the contiguous sub array read more | |

Sliding Window Maximum | In Sliding Window Maximum problem we have given an array nums, for each contiguous window of size read more | |

Delete And Earn | In delete and earn problem we have given an array nums, you may perform the following operation on read more | |

Length of Longest Fibonacci Subsequence | Given a strictly increasing array of positive integers, find the length of the longest fibonacci read more | |

Merging Intervals | In merging intervals problem we have given a set of intervals of the form [l, r], merge the read more | |

First Bad Version | We all have heard the saying “Bad Apple Ruins The Bunch”.First Bad Version is a problem read more | |

Peak Index in a Mountain Array | What is Peak Index in a Mountain Array Problem? An array can be said as a Mountain Array if it read more | |

4Sum | In the 4Sum problem, we have given an integer x and an array a[ ] of size n. Find all the unique read more | |

Create Maximum Number | In the Create Maximum Number problem, we have given two arrays of length n and m with digits 0-9 read more | |

Degree of an array | Problem Statement In the Degree of an array problem we have given a non-empty array of non-negative read more | |

Queue Reconstruction by Height | Problem Description of Queue Reconstruction by Height Suppose you have a random list of people read more | |

Search Insert Position | In the Search Insert Position problem, we have given an integer x and a sorted array a[ ] of size read more | |

Find Peak Element | Let’s understand Find Peak Element problem. Today we have with us an array that needs its read more | |

Valid Triangle Number | Problem In the Valid Triangle Number problem, we have given an array of non-negative integers. read more | |

Power of Two | In Power of Two problem we have given an integer, check if it is the power of 2 or not. A number in read more | |

Stone Game LeetCode | What is Stone Game problem? Stone Game LeetCode – Two players A and B are playing a stone read more | |

Maximum size subarray sum equals k | In Maximum size subarray sum equals k we have given an array of integers and a value k. You have to read more | |

Next greater element | The next greater element is a problem in which we have given an array. This array containing N read more | |

Guess The Word | Guess The Word is an interactive problem. An interactive problem means the data which is given to read more | |

Missing Number | In Missing Number problem we have given an array of size N containing a number from 0 to N. All the read more | |

Merge Sorted Array | In merge sorted array problem we have given two sorted arrays in increasing order. In input first, read more | |

Partition Equal Subset Sum | Partition Equal Subset Sum is a problem in which we have given an array of positive numbers. We read more | |

Last Stone Weight | Last Stone Weight is a problem in which we have a set of stones having some positive weights. Now read more | |

Sort Colors | Sort colors is a problem in which we have to given an array containing N objects. Each box is read more | |

Rotate Array | Rotate array is a problem in which we have given an array of size N. We have to rotate the array in read more | |

Subarray Sum Equals k | Given an integer array and an integer k. Find total number of contiguous subarrays of given array read more | |

Infix to Postfix | What is an infix expression? Expression in the form of ‘operand’ ‘operator’ ‘operand’ read more | |

Circular Queue | A circular queue is an advanced form of a linear queue. In the linear queue, we can’t insert an read more | |

Given a sorted array and a number x, find the pair in array whose sum is closest to x | ALGORITHM TIME COMPLEXITY: O(N) SPACE COMPLEXITY: O(1) 1. We initialize two pointer like variable read more | |

Find the subarray whose sum is equal to a given number X | Example INPUT 7, 3, 18, 2 and given number X = 23 OUTPUT SUBARRAY IS 3, 18, 2 whose sum is 23 read more | |

Arrange Even and Odd number such that Odd comes after Even | INPUT: 7 2 4 9 10 11 13 27 OUTPUT: 10 2 4 9 7 11 13 27 ALGORITHM TIME read more | |

Minimum number of Merge Operations to make an Array Palindrome | If it is not a palindrome it will make merge operations and prints the number of merge operations. read more | |

Form minimum number from given sequence of D’s and I’s | Example 1 INPUT : DIDI OUTPUT : 21435 Example 2 INPUT : DIDII OUTPUT : 214356 In example 1, the read more | |

Longest span with same sum in two binary arrays | Given two binary arrays, array1 and array2 with same size. This function will print the longest read more | |

Find the Subarray of given length with Least Average | Given an array and an input integer X, write a program to find the subarray of length X with read more | |

Find Zeros to be Flipped so that number of Consecutive 1’s is maximized | Given a binary array and number of zeros to be flipped, write a program to find the zeros that read more | |

Merge K Sorted Arrays and Print Sorted Output | Given k sorted arrays of size n each, write a program to merge those arrays and prints the sorted read more |

# Array Interview Questions

I am presenting a collection of commonly asked array interview questions. Array questions are the most asked questions these days. The interviewer wants to know, how efficient code you can write. Therefore practice technical questions on arrays.

These array practice questions will help you clear the difficult programming rounds. In other words, these rounds are based on array questions. But, you should practice it frequently. For example, you can practice 2 questions daily.

Below are the collections of array questions which will help you to practice questions on arrays. Practicing daily will help you to improve your programming logic to solve any new questions you will face.

Array interview questions will help you to clear at-least the first round of the technical interviews.

When you are working on array practice questions then keep one thing in mind to first solve the array questions without seeing the solution. After that, you can match how we have solved the question.