0% found this document useful (0 votes)
2 views3 pages

Array String Full Interview Questions

The document lists various interview questions categorized by difficulty level for arrays and strings. Array questions include tasks such as finding the largest element, merging sorted arrays, and solving the Two Sum problem, while string questions cover reversing strings, checking for anagrams, and calculating edit distance. The questions are divided into easy, medium, and hard categories for both arrays and strings.

Uploaded by

skw2909
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)
2 views3 pages

Array String Full Interview Questions

The document lists various interview questions categorized by difficulty level for arrays and strings. Array questions include tasks such as finding the largest element, merging sorted arrays, and solving the Two Sum problem, while string questions cover reversing strings, checking for anagrams, and calculating edit distance. The questions are divided into easy, medium, and hard categories for both arrays and strings.

Uploaded by

skw2909
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

Array and String Interview Questions (Easy,

Medium, Hard)

Array Questions

Easy (Array)
• Find the largest element in an array

• Find the smallest element

• Reverse an array

• Check if array is sorted

• Find the second largest element

• Count even and odd numbers

• Find the sum of all elements

• Move all zeros to the end

• Linear search in array

• Remove duplicates from a sorted array

Medium (Array)
• Two Sum problem

• Find the missing number (1 to n)

• Rotate array by K positions

• Merge two sorted arrays

• Find intersection of two arrays

• Find union of two arrays

• Kadane’s Algorithm (maximum subarray sum)

• Subarray with given sum

• Majority element (Moore’s Voting)

• Stock buy and sell problem

Hard (Array)
• Trapping Rain Water

• Maximum product subarray

• Median of two sorted arrays

• Longest consecutive sequence

• Count inversions in array

• Merge intervals
• Subarrays with XOR = K

• Next permutation

• Sliding window maximum

• Largest rectangle in histogram

String Questions

Easy (Strings)
• Reverse a string

• Check if a string is palindrome

• Count vowels and consonants

• Count frequency of each character

• Convert string to uppercase/lowercase

• Check if string contains only digits

• Remove spaces from string

• Find length of string (without inbuilt)

• Concatenate two strings

• Compare two strings

Medium (Strings)
• Check if two strings are anagrams

• Find first non-repeating character

• Remove duplicate characters

• Find all substrings

• String compression (aaabb → a3b2)

• Check if one string is rotation of another

• Find longest common prefix

• Convert string to integer (atoi)

• Group anagrams

• Longest substring without repeating characters

Hard (Strings)
• Minimum window substring

• Edit distance (Levenshtein distance)

• Wildcard pattern matching

• Regular expression matching

• Rabin–Karp string matching


• KMP algorithm (pattern searching)

• Longest palindromic substring

• Palindrome partitioning

• Word break problem

• Text justification

Apurva, you can do it ■■

You might also like