Microsoft's Internship Questions - 2011

21/02/2011 18:12

1. Given a matrix of dimension m x n and the elements are random enough. Find the element which occurs in all the m rows of the matrix.
 
2. Test a code which gives you the english format of a number. Eg. For input "546" output "Five hundred and forty six"
 
3. Delete a node from the doubly linked list
 
4. Given a matrix and print the spiral form of its values.
    Eg.    1    2    3
        4    5    6
        7    8    9
    Ans: 1 2 3 6 9 8 7 4 5
 
5. Two different linked lists join at a particular node. Find the node where they join together and makes a commom list further
    Eg. node0 -> node1 -> node2 -> node3-> NULL
        node4 -> node2 -> node3 -> NULL
         
6. You need to compress a file which has got unwanted whitespaces. If you find any tabs, new lines, carriage returns or more than one space, replace it with a single space(" ")
 
    Eg. This is       a 
        new         car!
        O/P: This is a new car!
         
7. Using Stacks implement Queue!
 
8. Find the nth node in a linked list from the end
 
9. Few more simple Questions on Construction and Searching BST.