Thursday, February 9, 2012

Interview Questions on Arrays for SDET interviews

1.Given an array containing lower case and upper case alphabets and numbers, how can you sort/arrange the array in one single pass using just one variable for swapping such that the resultant array should put the input elements into 3 buckets in the following fashion
Input - aA1B23Cbc4
Output - abcABC1234
Note - ordering doesn't matter the output could be ABC1234abc or 1234abcABC

2.How would you merge two sorted arrays (one array has extra slots) provided not to use a third array nor u can allocate extra space. try to optimize the problem to the best. time complexity should be less than O(n^2)

3.Given an array, find the first repeated number.

4.Find an Item in a Sorted Array with Shifted Elements

5.Find the number with odd number of occurrences.

6.Perform Binary Search on a Sorted Array.

7.Write a program to print array in spiral order.

8.Implement a Queue using Array.

No comments:

Post a Comment