Arrays Interview Questions

Array Interview Questions

Arrays interview questions are the favourite topic of Microsoft, Amazon, Google, VMWare, etc. We are providing list of questions on Arrays which will help you to challange the interviewrs. Below are the questions on array data structure. Array algorithm questions are first choice of interviewers. Below are important array questions for technical interviews.

Reverse Array

Write a program to reverse an array. This interview question is very common where interviewer wants to see whether you are capable of writing a optimized program to reverse an array. This program can be written in C++ or Java programming language.

Pair Sum Equals Number

You have to write a program to find the pair of elements from a given array whose sum is equal to a number provided. This interview question is commonly asked question during technical interviews.

Floor and Ceil

Write a program to find the floor and ceil in the array provided. Floor is just greater and ceil is just smallest number from the provided number. This question is also asked to test your logical skils in programming.

Largest Sum Subarray

Write a program to find the subarray with the largest sum. This array interview question is asked to check whether you are aware of Kadane's algorithm or not. You can choose Java or C++ to write the code.

Missing Number

Write a program to find the missing number from the array. This array interview question is a common question asked in technical interviews of most of the companies. Here interviewer is interested to know whether you are aware of XOR operations on array elements or not.

Odd Occuring Number

Write a program to find the number from an array which is occurring odd number of times. This question is also a common question for interviews. Here in this question interviewer again wants to see whether you can apply XOR operations on elements of array or not.

Sort by Frequency

Here you have to write a program/code to sort the elements of an array based on the frequency of their occurrences. This question is commonly asked interview questions on arrays. You can opt any language like Java or C++.

First and Second Smallest

Write a program to find two elements from an array which are smallest amoung all the elements of an array. This is also a commonly asked technical question on arrays.

Majority Element

Write a program to find the majority element from an array. Majority element is the the number which is occuring more than half of the size of array. Lot of users go with sorting the arrays. This is another set of common array questions asked during technical interviews. You can write a program in any language like C++ or Java.

Difference between elements

Write a program to find the maximum difference between two elements in the array such that larger element occurs after the smaller one. Here interviewer is interested to see your approach based on dynamic programming. This interview question should be answered using dynamic programming.

Arrange Even and Odd

Given an array of integers write a program to re-arrange numbers in such a way that odd number comes after even numbers. Here interviewer wants to see your approach to answer this question using two pointers or indices one pointing the first element and second pointing to last element. This is a commonly asked question in technical interview. You can write a program in any language like C++ or Java.

Closest Sum Elements

Write a program in C++ or Java to find the closest sum of any two elements of an array which is equal to the given number. This question is being asked in various interviews.

Distinct Elements

Write a program in any language like C++ or Java to find the distinct elements from an array. This array interview question is asked to see whether can you find unique elements from the provided array of elements?

First Repeating Number

You have to write a program to find the first repeating number from an array. There can be various repeating numbers in an array but yo need to find the first number which is occuring second time. This is again a good array interview question to see the implementation of Hashtable.

Common Elements in Arrays

You have three soted arrayrs and you have to find the common elements present in all three arrays. This is an interview question asked by companies multiple times. Most of the interviewee gets confused seeing three arrays.

Smallest Missing Number

Max Adjacent Sum

Find Occurrences of Number

Rotate Image

Distance Between Numbers

Pair with given difference

Product Array Puzzle

Replace Elements

First Repeating Element

Move Zeroes to End

Pythagorean Triplets

Maximum Average Subarray

Subarray Sum Equal to X 

Leaders in Array

Largest Pair Sum

Segregate 0s 1s and 2s

Find Duplicates

Consecutive Elements Check

Triplet with given Sum

Binary Search in Sorted Array

Fixed point in sorted array

Reorder Elements by Indexes

Merging two sorted arrays

Find next greater number 

Reorder array using given indexes

Count of triplets with sum less than given value

Merge two sorted arrays 

Subarray and Subsequence 

Rearrange array maximum minimum form

Find the lost element from a duplicated array

Count minimum steps to get the given array

Maximum element in an array which is increasing and then decreasing

Minimum number of jumps to reach the end of an array

Subarray with given sum

Length of Longest Increasing Subsequence

Smallest positive number missing unsorted array

The Celebrity Problem

Sorted subsequence of size 3

Partition Problem

Find pair with given difference

Maximum length of chain pairs

Four elements that sum to given

Maximum circular subarray sum

Count possible triangles

Longest Increasing Subsequence

Petrol Bunks Tour

Tug of War

Counting Sort

Maximum Repeating Number

Positive Negative Arrangement

Find a Peak element

Elements More Than n/k

Max Product Subsequence

Longest Bitonic subarray in an array

Number of smaller elements on right side

Implement two stacks in an array

Maximum sum increasing subsequence

Find the two numbers with odd occurrences in an unsorted array

Largest subarray with equal number of 0's and 1's

Maximum product subarray

Replace every element with the greatest on the right side in an array

Sorting a k sorted array

Find the row with maximum number of 1's

Shuffle a given array

Iterative Implementation of quick sort

Arrange given numbers to form the biggest number

Pancake sorting

Pancake sorting Problem

Maximum Subarray Sum using Divide and Conquer

Merge Overlapping Intervals

Stock Buy Sell to Maximize Profit

Sort Elements by frequency

Print all possible combinations of r elements in a given array of size n

Monotonically increasing function

Minimum element in a sorted and rotated array

Merge k Sorted Arrays

Flip Zeroes for Consecutive 1's

Least Average Subarray

Longest span with same sum in two binary arrays

Form minimum number from given sequence of D's and I's

Number of strictly increasing subarrays

Minimum difference between any two elements in an array

Number of pairs with given sum

Make Array Palindrome

Dynamic Programming, Longest Bitonic SubSequence

These are the good collection of array questions for technical interviews. Array algorithm questions are commonly asked questions for technical interviews.

Next >
Scroll to Top