0% found this document useful (0 votes)
3 views2 pages

1D Array Interview Questions Guide

Uploaded by

balaji1272k5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

1D Array Interview Questions Guide

Uploaded by

balaji1272k5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1D ARRAY INTERVIEW QUESTIONS (PLACEMENT

PREP)
Coverage: Arrays & 1D Arrays only (No number logic, no 2D arrays)

LEVEL 1: BASIC ARRAY OPERATIONS


1 Read and print array
2 Find array length
3 Traverse using loops
4 Access element by index
5 Update an element
6 Copy array manually
7 Compare two arrays
8 Reverse array (in-place)
9 Print even/odd index elements
10 Swap two elements using index

LEVEL 2: SEARCHING & OCCURRENCE


1 Linear search
2 Binary search (sorted array)
3 Frequency of each element
4 Find duplicate elements
5 Find unique elements
6 First repeating element
7 First non-repeating element
8 Count occurrences of given element
9 Check if element exists
10 Common elements in two arrays

LEVEL 3: ARRAY MODIFICATION (IN-PLACE)


1 Insert element at index
2 Delete element at index
3 Remove duplicates (sorted array)
4 Remove duplicates (unsorted array)
5 Shift elements left
6 Shift elements right
7 Move zeros to end
8 Move non-zeros to front
9 Alternate rearrangement
10 Replace every element with next

LEVEL 4: ROTATION & REARRANGEMENT


1 Left rotate by 1
2 Right rotate by 1
3 Left rotate by K
4 Right rotate by K
5 Reverse array in groups of K
6 Cyclic rotation
7 Positive at even, negative at odd
8 Small-large-small-large pattern
9 Reverse subarray
10 Swap alternate elements

LEVEL 5: SORTING & ORDER LOGIC


1 Bubble sort
2 Selection sort
3 Insertion sort
4 Sort ascending
5 Sort descending
6 Sort even index elements
7 Sort odd index elements
8 Sort 0s and 1s
9 Sort 0s, 1s, 2s (DNF)
10 Kth largest element
11 Kth smallest element

LEVEL 6: SUBARRAY & PREFIX


1 Generate all subarrays
2 Largest subarray
3 Smallest subarray
4 Prefix sum array
5 Suffix sum array
6 Equilibrium index
7 Maximum subarray sum (Kadane)
8 Minimum subarray sum
9 Longest increasing subarray

LEVEL 7: ADVANCED 1D ARRAY QUESTIONS


1 Leaders in array
2 Majority element (Moore’s Voting)
3 Missing and repeating element
4 Rearrange: arr[i] = arr[arr[i]]
5 Maximum j-i such that arr[j] > arr[i]
6 Trapping rain water
7 Stock buy and sell (single transaction)
8 Stock buy and sell (multiple transactions)
9 Maximum sum of non-adjacent elements
10 Circular array rotation & sum

You might also like