Posts Tagged Microsoft Interview

How to Test a simple Calculator Interview Question

This is a very common interview question and was very much expected when I appeared for my telephonic interview with Microsoft! And as expected I was asked this J “How would you test a calculator that does basic operations like addition, multiplication, division, subtraction and square root.

So here is a reasonable answer to ace this question. Testing formally is divided into two broad categories Functional testing and Non-Functional Testing.  To be very honest interviewer is NOT interested in how much you know about different types of testing rather they want to see how you’re thinking pattern works.

A model answer to this question can be as follows:

“To test a calculator it’s very important that we test both its functional aspects as well as non-functional requirements.  First I would be testing its functional aspects as follows:

a) Perform valid simple arithmetic operations on numbers and compare results with actual results

b) BODMAS: use a long string of different operations on numbers and see if it follows the BODMAS principle and calculates result accurately

c) Try dividing a number by zero and see the output

d) Calculate square root for a negative number and see the result.

e) Perform mathematical operations on very large numbers and see how it handles them.

f) Press and test the back button it should delete the last digit and update screen.

g) Clear button should reset the screen to zero.

h) Use of appropriate error messages.

i) Other aspects such as weight of the calculator should be as such as that it’s easy to carry; display screen should display the numbers big enough for proper visibility and durability of the product.

I hope it helps!

Comments (2)

Microsoft Technical Interview tips !

Over the past weeks or so I have been asked this question a lot of times “How to approach a Microsoft Interview?”   Based on my experience I would suggest the following to anybody who is going to appear for an interview for a technical position with Microsoft in coming future.

  • Know your Data Structures & Algorithms! If you read my interview experience you would see almost every question revolved around some data structure or the other. I suggest you review all popular data structures and algorithms and see how you can solve different problems using these data structures. On top of that it goes without saying that algorithms such as post order, pre order and in order traversal of a tree, traversing a linked list, reversing a linked list, reversing a string , hash tables, binary search trees, sorting algorithms, recursion vs. iterative should be on your finger tips! You should also be able to derive the space and time complexities of your code and how could you further optimize it.
  • Practice coding on a white board: Most of us have a mindset that we can only code using our editor and compiler to be sure that we have done it correctly. However life is not that straight forward! During your interviews you would have to write a piece of code on the white board where you won’t be having the services of our old friend “compiler”. I realized it during my interview that writing code on a white board is something that needs practice. So I suggest while you prepare for your interview get a white board and practice all your codes on it. Have a friend go through them with you once you have written them down.
  • Ask questions (logical): Most of the questions that are presented in the interview are very vague and it has a purpose. The interviewer is looking at how you dissect the problem before coming up with the solution; do you have that thinking ability to properly understand the problem before coming up with a solution for example “Delete a specific node from a linked list” if you jump straight down on writing a code for deleting a node without even being sure what kind of a linked list we have you are getting yourself in trouble! You can ask your interviewer questions like “is it a singly linked list? Doubly or circular linked list?” “What kind of data does It store” etc. This gives the interviewer an impression that you have the thinking skills to properly nail down a problem so that you are sure that you understood it fully. Probe for more details !
  • Don’t panic: Even though you might have practiced a lot of common interview questions but the actual interview questions might still be different. Just ensure that you have covered all the bases by revising all core concepts and make use of them to come up with a solution. The interviewers are not looking at exact answers to a problem rather how you approach a problem when pushed in a difficult situation. There is no harm in asking the interviewer to elaborate on the question if you couldn’t understand it the first time. Be confident!

  • Think aloud: As I just mentioned above that Interviewers are not looking for an exact solution to a problem and most of the times are looking how you approach a problem. The major thing here is that even if you are bogged down by the problem on hand; talk out aloud your thought process so the interviewer knows exactly on what lines your mind is thinking. I have seen many real examples of people who failed to solve a problem yet got offers because they were clear in communication with the interviewer.  I was confident enough in all the programming questions that were thrown at me so most of the time I dived straight into coding them on the white board which lead to an interviewer giving me feedback that “most of the interviewers don’t want you to jump straight into the code rather than thinking and doing some homework on the problem talking aloud”. So in a nut shell don’t dive straight into code and talk through your algorithm with your interviewer before writing the code.

I guess that’s very much about everything that you might need when you interview with Microsoft but if you if feel I left out something please leave a comment and I will be more than glad to answer or help. Hoping to see you soon at Microsoft Campus! Best of luck!

Leave a Comment

Microsoft Interview Experience

Last month I applied to Microsoft through their college recruiting website for SDE/SDET positions and to my amazement the very next day I was contacted by a recruiter who was interested in setting up a telephonic interview with me and had sent me a few initial questionnaires to fill back and return to her. We decided a date and time and I started waiting anxiously for the big day.

Phone Interview

Nicole (recruiter) was sharp on time on the interview day and started off the conversation in a very friendly manner which really helped easing my nerves out. There were no technical questions asked (although I was anticipating a lot of them) and most of the conversation revolved around my resume on questions such as what was your most challenging project? What would you have done different if allowed to go back in time? Do you like to work standalone or do you prefer team projects? Why do you want to work for Microsoft? And finally before we hung up the phone she said “Ok if I want you to test a calculator with simple mathematical functions and made for small children. How would you test it? “. I then asked here a large number of different questions on Microsoft’s work culture, salary and benefits and career paths before we ended the interview. I was pretty satisfied with my performance and was expecting a call up for further rounds.

After two weeks I was again contacted by another recruiter who wanted to set me up for a face to face interview in Dubai on 3rd March 2011.  I was asked to provide all my travelling details which I did so and Microsoft arranged a fully paid trip to Dubai for me.

My interview was in the evening session and to avoid any last moment delays I reached Microsoft Office 30 minutes before the scheduled time. I had to go over 4 technical interviews with Directors of Microsoft Business solutions, Windows Azure, Silverlight and Visual Studio groups respectively.

Interview-1

My first interview was with Director of Business Solutions group (Mr. Azfar). We started off with general discussion about my resume before I was handed a marker and was asked to solve problems on the white board.  The questions that I was asked here were as follows:

  • Write a function that takes a pointer to the head of a linked list and an index and deletes that node. Node consists of a void pointer data and link to the next node. Write test cases for this function.
  •  What’s the difference between master data and reference data?
  • Suppose you have to design the sales modules of an ERP system how you would structure the model for better reporting?
  • Suppose you are given a bit stream and you don’t know from where the bit stream starts. Write a function that returns true if the bit stream has an alternating pattern. For example 000000101010 would return true and 0000001010000 would return false.  Also I had to write test cases for the function.

I was very confident throughout and hardly faced any issue in nailing out the problems on the whiteboard.  I was walking through my algorithms keeping the interviewer in loop and also managed to come up with solid designs and test cases. The interview ended lasted for about 50 minutes after which I was given a 2 minute period to ask any questions if I had. Overall the first interview was a very satisfactory one and it geared me up for upcoming interviews.

We had a 15 minute break during which the recruiter on site Erick, a nice friendly chap made us fill some forms and asked me about my interests and possible teams I would like to work on.

Interview-2

My second interview was with Jason who is head of Testing in Microsoft Visual Studio team (if I am recalling correctly) he was one of the most nice fellows I have ever came across in my professional career he was very friendly and supporting throughout the interview.  Once again I was asked to code on the whiteboard. The coding problems were as follows:

  1. Write a function that takes two strings and returns true if one string is the substring of other.
  2. Suppose you have a  2D array whose elements are increasing both row wise and column wise and you have to find an element if it is present in the array or not. I had to come up with an efficient algorithm for doing this.
  3. Write test cases for both the above functions.
  4. Design a stack using two queues.

I got confused a bit during the interview and hence took longer than normal to solve these simple problems. However Jason was very comforting and supporting throughout.

Interview 3

Third interview was with Director of Windows Azure Development group. This interview focused totally on problem solving and writing test cases for the problems. The problems I was asked during the interview were

  1. Suppose you have a dictionary of words design an algorithm that would scan all words and determine all words that are anagrams. Your algorithm should be efficient and NOT O (n square).
  2. Write a function that would return the first non repeating character in a string. So “Total” would return 0.
  3. Write a function to print the mth from last element of a linked list. (m=0 is the last element). This had to be done using one loop only.
  4. Reverse a string in place ! (in place was the only catch here)

Once again I managed to come up with solutions of all the problems. There was a slight bug in my solution to problem 2 which the interviewer pointed out and I fixed it. Other than that the interviewer was pretty satisfied on how I approached the problems and covered all cases. I was pretty satisfied with this interview and was anxiously waiting for the next one.

 

Interview 4

This was my final interview for the day. I don’t exactly remember the name and designation of the recruiter but he was one friendly chap. Very energetic! And as soon as we entered the conference room he laid the rules straight away! “Write a fully working code! And write efficient code and nothing less!”  All I managed to do was to smile and reply back “ I will try my best”. This interview lasted for 50 minutes and I had just one problem to solve. The problem was as follows:

  1. Suppose you have Binary tree you want to store the binary tree somewhere on the disk or on the cloud once stored than write a routine that would retrieve and rebuild the tree. Cover all cases and come up with at least 10 solid cases.

After a few minutes of brainstorming I came up with an algorithm which I guess really took the interviewer with surprise and he was really impressed with the approach. We managed to walk through the algorithm and write proper code on the white board. The test case session was a very interactive one and I managed to come up with some strong test cases. Overall the interview ended up on a very satisfactory note and I walked out confident and hoping for success!

Post Interviews:

Microsoft gave all the candidates souvenirs and we left for our hotels. I had the flight same night so had little time to roam around Dubai.

Now after 3 days of my interview I was contacted back by Microsoft that they would like to make me an offer in their Dynamics team! It’s an amazing feeling and I have no words to explain this. I am looking forward to a life time experience at Microsoft in coming months!

If you have any questions related to my experience you can contact me by responding to the post.

Comments (28)