Microsoft Interview Questions (Part - III)

Leave a Comment
                     PART - I>>          PART - II>>
51. What are your geographical preferences?

52. What are your expectations from the job.

53. Give a good data structure for having n queues (n not fixed) in a finite memory segment. You can have some data-structure separate for each   queue. Try to use at least 90% of the memory space.

54. Do a breadth first traversal of a tree. (print a tree level by level, each   level in a different line)

56. Write, efficient code for extracting unique elements from a sorted list of   array.  e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).
 (Devise at least two different methods)

57. C++ ( what is virtual function ? what happens if an error occurs in constructor or destructor.
Discussion on error handling, templates, unique features of C++.
What is different in C++, ( compare with unix).

58. Given a list of numbers (fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list).

60. If you are on a boat and you throw out a suitcase, will the level of water increase?

62. write C code for deleting an element from a linked list (C++) traversing a linked list. Efficient way of eliminating duplicates from an array.
63. What are various problems unique to distributed databases?

64. declare a void pointer
     a)      void    *ptr;

65. make the pointer aligned to a 4 byte boundary in a efficient manner
    a)    Assign the pointer to a long number and the number with 11...1100 add 4 to the number

66. what is  a far pointer (in DOS)

67. what is  a balanced tree?

68. given a linked list with the following property
     node2 is left child of node1, if node2 < node1
     else, it is the right child.
    O P

    |

    |

    O A

    |

    |

    O B

    |

    |

    O C
    How do you convert the above linked list to the form without disturbing the property. Write C code for that.

           O P

           |

           |

           O B

              / \

             /   \

            /     \

           O ?     O ?
determine where do A and C go

69. Describe the file system layout in the UNIX OS
     a)  describe boot block, super block, inodes and data layout

70. In UNIX, are the files allocated contiguous blocks of data
     a)      no, they might be fragmented how is the fragmented data kept track of.
     a) describe the direct blocks and indirect blocks in UNIX file system

71. Write an efficient C code for 'tr' program.  'tr' has two command line arguments. They both are strings of same length. tr reads an input file, replaces each character in the first string with the corresponding character in the second string. eg. 'tr abc xyz' replaces all 'a's by 'x's, 'b's by 'y's and so on.
 a)      have an array of length 26.
         put 'x' in array element corr to 'a'
         put 'y' in array element corr to 'b'
         put 'z' in array element corr to 'c'
         put 'd' in array element corr to 'd'
         put 'e' in array element corr to 'e'
         and so on.
    the code
       while (!eof)
       {
           c = getc();
           putc(array[c - 'a']);
       }

72. what is disk interleaving?

73. why is disk interleaving adopted?

74. given a new disk, how do you determine which interleaving is the best
     a)      give 1000 read operations with each kind of interleaving
         determine the best interleaving from the statistics

75. draw the graph with performace on one axis and 'n' on another, where 'n' in the 'n' in n-way disk interleaving.

76. A real life problem - A square picture is cut into 16 squares and they are shuffled.  Write a program to rearrange the 16 squares to get the original big square. (backtracking)

 78. What is the difference between an Ethernet and an ATM?

0 comments:

Post a Comment