Friday, March 30, 2012

Some recent interview questions

1. How would you determine whether a singly linked list contains a loop? Write the test cases for the same.

2. Calculate the angle between the minute and hour hand of a clock for a given time.Write test cases for the same.

3. How to delete a node in a linked list when no pointer to that node is provided?

4. How to find the second last word in a given string? Write the test cases for the same.

5. Reverse a linked list and write test cases.

6. Write a program to get the Fibonacci series.

7. How would you reverse a given integer. (the interviewer said without converting it to a string)

8. This was a SQL question : Suppose you have multiple pages on a website and each page has multiple impressions. Write a SQL query to get the impressions per page. The interviewer expected a join query.

9. This was a design question : Write a generic class to track out if credit card of an user is lost. He asked how will you come to know that the card is lost and then asked to write from a programmers point of view.

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.

Tuesday, January 10, 2012

Some links I would like to share with:
http://www.guru99.com/software-testing.html
http://www.careerride.com/Automated-Testing-Interview-Questions.aspx