Most Frequently Asked String and Array Interview
Questions (Freshers Software Engineer)
String Questions
• Reverse a string.
• Check if a string is a palindrome.
• Count vowels and consonants in a string.
• Find the first non-repeating character.
• Check if two strings are anagrams.
• Remove duplicates from a string.
• Find all substrings of a string.
• Convert string to integer (atoi).
• Check if a string contains only digits.
• Find the longest substring without repeating characters.
• String compression (e.g., aaabb → a3b2).
• Count frequency of each character in a string.
• Check if one string is rotation of another.
• Find common characters between two strings.
• Capitalize first letter of each word.
Array Questions
• Find the largest and smallest element in an array.
• Reverse an array.
• Remove duplicates from an array.
• Find the second largest element.
• Check if array is sorted.
• Rotate array by K positions.
• Find missing number in array (1 to n).
• Move all zeros to end.
• Find intersection of two arrays.
• Find union of two arrays.
• Find subarray with given sum.
• Kadane’s Algorithm (maximum subarray sum).
• Two sum problem.
• Merge two sorted arrays.
• Find majority element (Moore’s Voting Algorithm).
• Stock buy and sell problem.