An **array** is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. The simplest type of data structure is a linear array, also called one-dimensional array.

Arrays are among the oldest and most important data structures, and are used by almost every program. They are also used to implement many other data structures, such as lists, heaps, hash tables, deques, queues, stacks, strings.

Below is the list of commonly asked interview questions that uses array data structure –

- Find pair with given sum in the array

- Check if subarray with 0 sum is exists or not

- Find sub-array with 0 sum

- Sort binary array in linear time

- Find a duplicate element in a limited range array

- Find largest sub-array formed by consecutive integers

- Find maximum length sub-array having given sum

- Find maximum length sub-array having equal number of 0’s and 1’s

- Sort an array containing 0’s, 1’s and 2’s(Dutch national flag problem)

- Inplace merge two sorted arrays

- Merge two arrays by satisfying given constraints

- Find index of 0 to replaced to get maximum length sequence of continuous ones

- Find maximum product of two integers in an array

- Shuffle a given array of elements (Fisher–Yates shuffle)

- Rearrange the array with alternate high and low elements

- Find equilibrium index of an array

- Find majority element in an array (Boyer–Moore majority vote algorithm)

- Move all zeros present in the array to the end

- Replace each element of array with product of every other element without using / operator

- Find Longest Bitonic Subarray in an array

- Find maximum difference between two elements in the array by satisfying given constraints

- Maximum subarray problem (Kadane’s algorithm)

- Print continuous subarray with maximum sum

- Maximum Sum Circular Subarray

- Find all distinct combinations of given length

- Find all distinct combinations of given length with repetition allowed

- Find maximum sequence of continuous 1’s formed by replacing at-most k zeroes by ones

- Find minimum sum subarray of given size k

- Find subarray having given sum in given array of integers

- Find the length of smallest subarray whose sum of elements is greater than the given number

- Find largest number possible from set of given numbers

- Find the smallest window in array sorting which will make the entire array sorted

- Find maximum sum path involving elements of given arrays

- Maximum profit earned by buying and selling shares any number of times

- Trapping Rain Water within given set of bars

- Longest Increasing Subsequence

- Longest Decreasing Subsequence Problem

- Find maximum product subarray in a given array

- Find maximum sum of subsequence with no adjacent elements

- Find minimum platforms needed in the station so to avoid any delay in arrival of any train

- Decode the array constructed from another array

- Sort an array using one swap

- Find Triplet with given sum in an array

- Length of longest continuous sequence with same sum in given binary arrays

- Rearrange array such that A[A[i]] is set to i for every element A[i]

- Reverse every consecutive m elements of the given subarray

- Maximum Product Subset Problem

- Find pairs with given difference k in the array

- Find pairs with given difference k in the array | Constant space solution

- 4 sum problem | Quadruplets with given sum

- Print all quadruplets with given sum | 4-sum problem extended

- Find odd occurring element in an array in single traversal

- Find two odd occurring element in an array without using any extra space

- Quickselect Algorithm

- Merging Overlapping Intervals

- Activity Selection Problem

- Job Sequencing Problem with Deadlines

- Introduction to Priority Queues using Binary Heaps

- Min Heap and Max Heap Implementation in C++

- Min Heap and Max Heap Implementation in Java

- Heap Sort (Out-of-place and In-place implementation in C++ and C)

- Check if given array represents min heap or not

- Convert Max Heap to Min Heap in linear time

- Find K’th largest element in an array

- Sort a K-Sorted Array

- Merge M sorted lists of variable length

- Find K’th smallest element in an array

- Find smallest range with at-least one element from each of the given lists

- Merge M sorted lists each containing N elements

- Insertion sort | Iterative & Recursive

- Selection sort | Iterative & Recursive

- Bubble sort | Iterative & Recursive

- Merge Sort

- External merge sort

- Iterative Merge Sort Algorithm (Bottom-up Merge Sort)

- Quicksort

- Iterative Implementation of Quicksort

- Hybrid QuickSort

- Quicksort using Dutch National Flag Algorithm

- Quick Sort using Hoare’s Partitioning scheme

- Custom Sort | Sort elements by their frequency and Index

- Custom Sort | Sort elements of the array by order of elements defined by the second array

- Inversion Count of an array

- Segregate positive and negative integers in linear time

- Binary Search

- Ternary Search vs Binary search

- Interpolation search

- Exponential search

- Find number of rotations in a circularly sorted array

- Search an element in a circular sorted array

- Find first or last occurrence of a given number in a sorted array

- Count occurrences of a number in a sorted array with duplicates

- Find smallest missing element from a sorted array

- Find Floor and Ceil of a number in a sorted array

- Search in a nearly sorted array in O(logn) time

- Find number of 1’s in a sorted binary array

- Find the peak element in an array

- Maximum Sum Subarray using Divide & Conquer

- Find Minimum and Maximum element in an array using minimum comparisons

- Matrix Chain Multiplication

- 0-1 Knapsack problem

- Maximize value of the expression

- Partition problem

- Subset sum problem

- Minimum Sum Partition problem

- Rod Cutting

- Coin change-making problem (unlimited supply of coins)

- Coin Change Problem (Total number of ways to get the denomination of coins)

- Longest alternating subsequence

- Combinations of words formed by replacing given numbers with corresponding alphabets

- Decode the given sequence to construct minimum number without repeated digits

- All combinations of elements satisfying given constraints

- Print all Triplets that forms Arithmetic Progression

- Print all triplets that forms Geometric Progression

- Find Missing Term in a Sequence in log(n) time

- Print all distinct Subsets of a given Set

- Find Floor and Ceil of a number in a sorted array (Recursive solution)

- Set both elements of a binary array to 0 in single line

- K-Partition Problem | Printing all Partitions

- 3 Partition Problem

- 3-partition problem extended | Print all partitions

- Find two duplicate elements in an limited range array (using XOR)

- Find missing number and duplicate elements in an array

- Find Minimum and Maximum element in an array by doing minimum comparisons

- Find Frequency of each element in a sorted array containing duplicates

- Difference between Subarray, Subsequence and Subset

**Thank you for being with us. 🙂**

## Leave a Reply