Amazon Interview Experience | Set 354 (For SDE-2)
I went for face to face interview and faced following questions....
read more
Modify string by replacing all occurrences of given characters by specified replacing characters
Given a string S consisting of N lowercase alphabets and an array of pairs of characters P[][2], the task is to modify the given string S by replacing all occurrences of character P[i][0] with character P[i][1]....
read more
Split an array into equal length subsequences consisting of equal elements only
Given an array arr[] of size N, the task is to check if it is possible to split the array arr[] into different subsequences of equal size such that each element of the subsequence are equal. If found to be true, then print “YES”. Otherwise, print “NO”....
read more
Print all possible palindromic string formed using any pair of given strings
Given an array of strings arr[] containing N words, the task is to print all possible palindromic string by combining any two strings from the given array....
read more
Check whether array has all identical elements using Arrays.asList() and HashSet in Java
Given an array arr[] of N elements, the task is to check whether the array have all same (identical) elements or not without using the loop. If all elements are same then print Yes otherwise print No....
read more
Count number of Distinct Substring in a String
Given a string, count all distinct substrings of the given string....
read more
Find the only repetitive element between 1 to N-1
Given an array of size N filled with numbers from 1 to N-1 in random order. The array has only one repetitive element. The task is to find the repetitive element....
read more
Count subarrays with equal number of 1’s and 0’s
Given an array arr[] of size n containing 0 and 1 only. The problem is to count the subarrays having an equal number of 0’s and 1’s....
read more
Find uncommon characters of the two strings
Find and print the uncommon characters of the two given strings in sorted order. Here uncommon character means that either the character is present in one string or it is present in another string but not in both. The strings contain only lowercase characters and can contain duplicates. Source: Amazon Interview Experience | Set 355 (For 1 Year Experienced)...
read more
Print all strings from given array that can be typed using keys from a single row of a QWERTY keyboard
Given an array of strings arr[], consisting of strings made up of lowercase and uppercase letters, the task is to print all the strings from the given array that can be typed using keys from a single row of a QWERTY keyboard....
read more
Count subsets having distinct even numbers
Given a sequence of n numbers. The task is to count all the subsets of the given set which only have even numbers and all are distinct....
read more
Count pairs whose product contains single distinct prime factor
Given an array arr[] of size N, the task is to count the number of pairs from the given array whose product contains only a single distinct prime factor....
read more