Microsoft IDC Interview Experience

First Interview:

The interviewer initially asked me all about my internship project and my role in that.

1. Given an Ellipse class can you derive a Circle class from it?
What all methods would you include in the circle class and what all in
ellipse?
Design a class of curve from which Circle and Ellipse can be inherited.


2. This contained series of questions on C++.
  • What are virtual functions? Why are they used? Give examples.
  • What are pure virtual functions and abstract classes? When do we use it?
  • Where are virtual functions stored in the memory? How does the object knows that the virtual function to be called is from base class or derived class?
  • What is VTable (virtual table) and what does it do?
  • Few more similar questions that I am not able to remember.

3. These were also series of Questions mostly on OS skills:
  • What are DLLs? Why do we use them?
  • How does DLL work? Can anybody call methods written in DLLs ?
  • What are static and shared Library? Which is fast and why?
  • Questions about paging, loading, linking etc.
  • Concept of 32-bit OS, virtual memory, inter-process communication etc.
  • Few more similar questions that I am not able to remember.

4. Given a BST (Binary search Tree) how will you find median in that?

Constraints:
  • No extra memory.
  • Function should be reentrant (No static, global variables allowed.)
  • Median for even no of nodes will be the average of 2 middle elements and for odd no of terms will be middle element only.
  • Algorithm should be efficient in terms of complexity.

Write a solid secure code for it.

Second Interview:

Again, the interviewer asked me about my internship project and my role etc stuff.

1) He gave me a question that suppose you are getting an infinite binary stream of characters then after any point of time you need to print whether the no is divisible by 3 or not, how will you do that?

I was bit confused. I asked him that how are we getting the stream? Then he told me that you take a function signature as:

 char getStreamBit();


which will return you the bit character (either '1' or '0') one by one. Also in the end he asked me to write the code of my algorithm on the board.

2) Then he asked me if I have any questions? I asked about 2-3 questions.

He was in hurry, so he left after that.

First and Second interview
together lasted for JUST 1 hour and 45 minutes.

Third Interview:

Again, he too asked me about my internship project, implementation, my role etc.

1. Modified 2 color sort problem i.e. you are given an array of integers containing only 0s and 1s.You have to place all the 0s in even position and 1s in odd position. And if suppose, no. of 0s exceed no. of 1s or vice versa then keep them untouched. Do that in ONE PASS and without taking extra memory (modify the array in-place).

For Example :

Input Array: {0,1,1,0,1,0,1,0,1,1,1,0,0,1,0,1,1}
Output Array: {0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1}

Write a solid secure code for it.

2. You are given a Linked List and a function declaration as node* KReverse(node* head, int k);

KReverse is a function that reverses the nodes of a Linked List k at a time and then returns the modified Linked List.

For Example

Linked List : 1->2->3->4->5->6->7->8->9->10->11

For k = 2

Return Value: 2->1->4->3->6->5->8->7->10->9->11

For k = 3

Return value: 3->2->1->6->5->4->9->8->7->10->11

Write a solid secure definition for the function KReverse.

Constraints:
  • If the no. of nodes in a link list is not a multiple of k then left-out nodes in the end should remain as it is.
  • You have to retain the memory address of the nodes without modifying it i.e. you can't just interchange the values in the nodes.
  • No extra memory allowed.

He tested some of his inputs with the code I wrote.

The third interview lasted for about little more than 1.5 hrs and in the end he also offered me some fruits (Apple, Guava etc) and asked me about my college etc.

Fourth Interview:

I had my fourth interview too.

1. Initially he asked me about my earlier interviews. Who were your interviewers, how did you perform etc. things. I told him that in my first interview I just made a small mistake writing code (median of BST under constraints) for one of the case. So he asked me to complete my code for that case too and write solid secure code only.

He was very very particular about the code rather than the problem solving aspect for this question. He was basically checking my concepts about pointers, memory allocation etc things in whole interview and my way of writing code.

2. Suppose you are passing a string to a Formatter function. Get the formatted news feed output string such that
  • There should be one sentence per line.
  • There shouldn't be any spaces i.e. the line shouldn't be blank.
For example:

Input String:

". ....West Indies reached the final of DLF series. .Lalu was invited
to IIM-A once again. . .. .. . Microsoft unveils Zune, an ipod killer. .
. . . "

Output String:

"West Indies reached the final of DLF series.
Lalu was invited to IIM-A once again.
Microsoft unveils Zune, an ipod killer."

Design and write solid secure code for the Formatter Function.

As I said earlier, he was very particular about the code. This is where you need to follow all the standards, convention and check for the test cases. He just wanted to check my concepts about the pointers, memory allocation, OS etc stuff and of course the logic proposed by me for this particular problem(and questions like how much extra memory do you need for the output
string, how can you reduce that etc, complexity etc things)

He then asked me to give some of the test cases for the input string.

In between, he kept me asking questions like what if type int(32 bit) is replaced with type int64 (64bit). What modifications will you make to your code. Questions about double pointers, segmentation fault, all conceptual questions again!

Then he asked me about my interests. Why should we hire you etc HR questions. If you have any questions etc. stuff

4 comments:

  1. could anyone please tell ... how to prepare....

    ReplyDelete
  2. int input_array[] = {0,1,1,0,1,0,1,0,1,1,1,0,0,1,0,1,1};
    int n_elements = sizeof(input_array)/sizeof(int);
    int i=0, j=n_elements-1, temp=0;

    while(i<j)
    {
    if(input_array[i] == i%2)
    {
    input_array[i] = input_array[i];
    i++;
    }
    else
    {
    if(input_array[i] != input_array[j])
    {
    temp = input_array[i];
    input_array[i] = input_array[j];
    input_array[j] = temp;

    j = n_elements-1;
    continue;
    }
    j--;
    }
    }

    ReplyDelete
  3. INTERNATIONAL CONCEPT OF WORK FROM HOME
    Work from home theory is fast gaining popularity because of the freedom and flexibility that comes with it. Since one is not bound by fixed working hours, they can schedule their work at the time when they feel most productive and convenient to them. Women & Men benefit a lot from this concept of work since they can balance their home and work perfectly. People mostly find that in this situation, their productivity is higher and stress levels lower. Those who like isolation and a tranquil work environment also tend to prefer this way of working. Today, with the kind of communication networks available, millions of people worldwide are considering this option.

    Women & Men who want to be independent but cannot afford to leave their responsibilities at home aside will benefit a lot from this concept of work. It makes it easier to maintain a healthy balance between home and work. The family doesn't get neglected and you can get your work done too. You can thus effectively juggle home responsibilities with your career. Working from home is definitely a viable option but it also needs a lot of hard work and discipline. You have to make a time schedule for yourself and stick to it. There will be a time frame of course for any job you take up and you have to fulfill that project within that time frame.

    There are many things that can be done working from home. A few of them is listed below that will give you a general idea about the benefits of this concept.

    Baby-sitting
    This is the most common and highly preferred job that Women & Men like doing. Since in today's competitive world both the parents have to work they need a secure place to leave behind their children who will take care of them and parents can also relax without being worried all the time. In this job you don't require any degree or qualifications. You only have to know how to take care of children. Parents are happy to pay handsome salary and you can also earn a lot without putting too much of an effort.

    Nursery
    For those who have a garden or an open space at your disposal and are also interested in gardening can go for this method of earning money. If given proper time and efforts nursery business can flourish very well and you will earn handsomely. But just as all jobs establishing it will be a bit difficult but the end results are outstanding.

    Freelance
    Freelance can be in different wings. Either you can be a freelance reporter or a freelance photographer. You can also do designing or be in the advertising field doing project on your own. Being independent and working independently will depend on your field of work and the availability of its worth in the market. If you like doing jewellery designing you can do that at home totally independently. You can also work on freelancing as a marketing executive working from home. Wanna know more, email us on workfromhome.otr@gmail.com and we will send you information on how you can actually work as a marketing freelancer.


    Internet related work
    This is a very vast field and here sky is the limit. All you need is a computer and Internet facility. Whatever field you are into work at home is perfect match in the software field. You can match your time according to your convenience and complete whatever projects you get. To learn more about how to work from home, contact us today on workfromhome.otr@gmail.comand our team will get you started on some excellent work from home projects.


    Diet food
    Since now a days Women & Men are more conscious of the food that they eat hence they prefer to have homemade low cal food and if you can start supplying low cal food to various offices then it will be a very good source of income and not too much of efforts. You can hire a few ladies who will help you out and this can be a good business.

    Thus think over this concept and go ahead.

    ReplyDelete