Sunday, January 23, 2011

Microsoft Written - 18th January, 2011

Microsoft visited our campus on 18th January, 2011 for campus placement. It was offering Internships to the pre-final year students. The whole 3rd year batch of IT & CSE was excited for this opportunity, and were looking forward to it. Finally the day came, and the PPT was scheduled at 12:00 AM, but it got postponed by a hour. We all were waiting for the PPT, but suddenly we got an announcement that the written exam will be held first, and then the PPT.

Written Exam : The papers were distributed, and we were given one and half hours for 11 questions. I'll try to summarize all the questions, as far as I remember.

No. 1) How will you sort an array of integers?

I was not sure what should I write in this, the code or just the algorithm. So I asked the Microsoft person, he said that code will be preferred but they will not look into the syntax. So wrote the code for Quick Sort ( with a time complexity of O(nlogn) ).
But I guess that they intended us to write the various sorting algorithms we will apply depending upon what type of input we get.

No. 2) Write a code to find the character which has the maximum occurrence in a string of ASCII characters, and print that maximum number.

This seemed pretty easy, I didn't think much into the complexity of the algorithm and wrote a O(n^2) algo. They intented us to write an O(n) algo, which was also easy to think. Just take an array of 256 (as there are 256 ASCII characters), and store the frequency of all the characters from input in this array. And then traverse this array, to find the character with maximum frequency.

No. 3) A code was given and we had to write the output.

This was simple, testing the basic concept of pointers. Only one twist was, which some of them got it wrong,

char c[]="TITAN";
void * vp;
vp = (char *)c;
printf("%s", vp+3);

The output will be "AN". Some of them wrote only "A", not looking that there was "%s", which will terminate with '/0'.

No. 4) A flowchart was given, showing steps of how a email is sent, there were some checking that if the email address is valid, and if the mail contained some matter. We had to write some cases to check if the system was working or not.

I had no idea about this, how to approach this problem. So I didn't attempt this question.

No. 5) Write test cases to test a web search engine?

I had no idea about this question. Test a web search engine, it just seemed out of domain.
Question no. 4 and 5 was for the testing people, and I was poor in testing :(

No. 6) There is a very complex software, which is made available for 90% of the time, and the MTBF ( Mean Time Between Failure) is 200 days. Now the company decides to make the software available for 95%, and hence the mean time for testing increases by 5 days, you need to calculate the new MTBF.

I converted the problem to mathematics, and tried to solve it.

No. 7) What is the disk access time?

It was a multiple choice question, and pretty simple for those who have studied OS.

No. 8)
Find the next number in the series. 5,6,7,8,8,8,8,8, ?

It seemed tough, I tried to think of something and came up with an answer 9. Later came to know this infact was the correct answer. There were possibly two logic to solve this.
*)The most significant digit after decimal in n/(n+1) , where n>=1.
*)The series was part of the second order Josephus Problem, where every second person is marked, and last person remaining is eliminated. This continues till we have a single person.

No. 9)
Given a red coloured cube, the cube is divided such that, after division the one edge of the cube has an edge one-third of the main cube. You need the find the number of cubes with 0 Faces, 1 Faces, 2 Faces, 3 Faces coloured. Why?

They wanted the correct answer and the approach was also important.
*)There will be one cube with 0 faces coloured, the one in the centre.
*)12 cubes with 2 faces coloured, since there are 12 edges in a cube, cube containing those edges will have 2 faces colored.
*)8 cubes with 3 faces coloured, there are 8 corners in a cube.
*)6 cubes with 1 faces colored, as there are 6 faces in a cube.

No. 10) This was a trouble shooting question. Suppose you are watching a video in your desktop, and suddenly the screen goes blank. What are the steps that you will take to find the faulty component?

I thought that there is some fault in hardware, nothing to do with software. Just mentioned some steps that I would take.

No. 11) You had to design a navigating system for a space research organization, that will monitor the take-off and landing of the space ship. Some more requirements were given.

I mentioned some points that came to my mind, mentioned that the system would keep track of the speed. There will be mechanism so that the crew members can interact with each other. Some more points.

Then we attended the PPT, it was a good one. I being a FOSS enthusiast asked then a question, How much is Linux a threat to Windows? , Why does government support FOSS?

After this was the wait for the results, which they said would come the same day. But it came on 19th, at around 12:30 PM. Ankit Arun the TPR of my department, called me up and informed me about the results. And said to come fast.

My interview experience in the next post... :)

3 comments:

  1. Nice work navin...Informative blog..with all the detailed description..keep writing :)

    ReplyDelete
  2. @pankaj: no its not, try compiling th code.

    ReplyDelete