Friday, February 17, 2012

Stack and Queue interview questions

Implement a Stack functionality using queue.

Imlement a Queue functionality using stack.
Binary tree interview questions:

Convert a Binary Search tree into a Doubly Linked list.

What is a B+ tre and B tree?
Linked List interview questions:

Remove duplicates from a linked list. The linked list is unsorted.

Shuffle and merge two given linked lists such that take every alternate element from each list and merge.

How to make copy of a linked list?

How do you break a given linked list into smaller lists (group od 1s,2s,3s)

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.