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)

H1B Visa Interview Experience Islamabad

Having received my I797 Form from Microsoft last month or so I finally scheduled an interview appointment with American Embassy this month. My Interview date for H1b Visa Application was 22nd August 2011 at American Embassy Islamabad.

The interview spanned over 10 minutes at max and the transcript of the interview is as follows:

VO (Visa Officer): Good morning sir, how are you doing today?
Me: Fine, Thank you and how are you doing today?
VO: Not bad either.
VO:  So you are going to Microsoft? I have heard about this company, sorry I forgot what do they do?
Me:  Microsoft is the world’s largest IT Company that develops and licenses a wide range of products and services in computing.  Microsoft windows being there flagship product which you might be using as well in your system right now.
VO: Oh definitely yes I am! So they are based in Redmond, Washington. Are you going there as well?
Me: Yes.
VO: So how did they hire you? Can you explain the whole recruitment cycle? How many interviews? And when did you get the offer?
Me: I answered appropriately explaining how I applied and went for interviews and then finally receiving the offer.
VO: How long is your contract with them?
Me: Stated this from my terms and conditions with Microsoft.
VO: How much would they be paying in you per annum?
Me: Stated appropriately from my offer letter.
VO: Would they renew your contract beyond X years?
Me: Hopefully Yes!
VO: So what exactly you would be doing at Microsoft?
Me:  I stated my Job Responsibilities as mentioned in my Job description.
VO: How many years of professional experience you have now in your field?
Me: Stated Appropriately.
VO: Can I please see your Microsoft Offer letter and original I797?
Me: Yes sure! and I showed him the original documents.
VO: Very Well done sir, I guess you have presented your case very well hopefully you would get your visa and passport within 7-10 days. Allah Hafiz!

Me: Ohh Thank you very much!  Pleasure meeting you. Have a good day! Allah hafiz.

I hope this visa experience helps other people who intend to apply for H1B.

Comments (5) Exclusive New Pakistani Web Portal Allows Students and Teachers to Interact

For Immediate Release Exclusive New Pakistani Web Portal Allows Students and Teachers to Interact


Lahore, Pakistan (8/13/2011) – A groundbreaking new web portal, exclusive to the people of Pakistan, has now been launched, allowing students and teachers to interact in a manner that offers a more meaningful educational experience. gives both teachers and students the chance to interact in a manner that offers students the abilities to make better informed decisions regarding their education while offering teachers the ability to better manage time and resources. Across Pakistan, students and teachers often find it difficult to locate a teacher. Even more of an issue is the difficulty in locating a teacher that meets the needs of the student in the desired categories. The ability of students and parents to now search for qualified teachers and view their profiles prior to making a selection will greatly enhance the overall educational experience.


Upon registration, students receive the ability to review profiles of thousands of teachers available in a wide variety of categories. In addition, this state-of-the-art system also allows students to post a request for a teacher via the teacher request board. Students also have the opportunity to decide whether they wish to obtain services either monthly or on a per-lecture basis. Services may also be requested for online sessions through USTAAD as well. To facilitate the review process for everyone, students are able to rate teachers after they have acquired services or if they have a past experience with a teacher on the site. As a result, every teacher on USTAAD has a viewable rating.


As an example of USTAAD’s commitment to providing revolutionary services, teachers are able to respond to requests they receive by messages or even accept a teacher request as it is posted on the board. Consequently, teachers are better able to manage their resources and time. The exclusive teacher dashboard provides teachers with the ability to manage their profiles as well as their inquiries and messages. There is also a special metrics section that gives teachers the opportunity to view the popularity of their profile in regards to the number of views received, providing the chance for teachers to better understand student response to their teaching style and technique.


With all of the many benefits offered to both teachers and students, USTAAD is an online community for people who love to learn. All of the tools teachers and students need to better manage their educational and occupational experiences are easily accessible.  Both teachers and students can register through the site to learn more about the various services offered. For more information, visit



Leave a Comment

How teachers will benefit from is an online system that would allow teachers from all disciplines to manage their teaching business more effectively. In the coming months there are a lot of planned developments for that would totally revolutionize how students/parents search for appropriate teachers and classes all across Pakistan. Some major benefits teacher will get by signing up for is as follows 1. Profile builder is an online system that would allow teachers from all disciplines to manage their teaching business more effectively. In the coming months there are a lot of planned developments for that would totally revolutionize how students/parents search for appropriate teachers and classes all across Pakistan. Some major benefits teacher will get by signing up for is as follows

1. Profile builder allows a teacher to build his public profile. This would include their education, certifications, experience, profile picture, service fees and much more.

2. City wise categorization allows students to search for a teacher in a more efficient way, hence increases your chances of getting new students.

3. Full Access to our teacher request board.

4. Your current/old students can leave you reviews. Good reviews on your profile increases your chances of getting new students.

5. will market your profiles on all social mediums giving you increased exposure. Let us handle all your marketing and you concentrate on what you do best! That is teaching.

Leave a Comment

Microsoft SDET Interview Experience-2

A few days back I wrote down my SDET interview experience with Microsoft. The experience can be read at

Today a friend of mine who also works in Microsoft currently as SDET shared his interview experience for my blog.  Here are the questions he was asked during his interview with Microsoft.

Okey here are the questions they asked me in a total of 10 interviews :).
1. You have to play a game. You have a 4×4 matrix with random number from 1-15 in it. One box is empty. Only following moves are available you can swap top or bottom or right or left element with the empty box (no diagonal swaps). You have to sort the cube 1 – 15 in the 2D array and the hole should move to the end.
2. you have an array of 100 elements which can have numbers from 1 – 99. The array is filled one number is repeated, what is the number.
3. you have to print the list of all the files in a directory and all its sub directories.
4. you have a number, consider this number on a key pad where it has 3/4 english language alphabets associated with it, like 1 corresponds to abc and so on. Print all the possible alphabet permutations for this number.
5. develop the back functionality for internet explorer’s back button.
6. Write test cases for you FYP, for your best project and for the projet you are working on currently.
7. what is good code. test a pen. You have to make a presentation and you dont have the book what will you do.
8. There is a function which draws a line on the screen. Test the function.
9. You have a circular singly link list. Add an element at the end of the list but you cannot traverse the list.
10. Find duplicates in a string.
11. Give a lecture on memory.
12. what is process, thread.
13. Propose an algo/data struct for memory manager.
14. Propose and algo/data struct for timer manager.

I hope his interview proves beneficial for everyone who is going to appear for an interview. Good luck ! and see you soon @ Microsoft.


Leave a Comment

Print a tree level by level (Level Order Traversal)

Printing a tree level by level

A common interview question in which you would be asked to write a code that would print a binary tree by level. For example the below binary tree when passed to your code should print 7,6,11,3,5,13,12






This is also known as level order traversal. The level order traversal of a tree is also breadth first traversal of the tree. The concept of level order traversal is to visit the root and then visit all nodes 1 level away, then all nodes 2 levels away and so on. We would need a queue to perform this kind of traversal.

The psuedocode for the program would be as follows:

Create an empty queue “Q”
enqueue the root element of the tree
while queue is NOT empty
dequeue an element from the queue
print element
Get children of the dequeued element
enqueue children

Having written the psuedocode its now very straight forward to convert this into a working C++ code.



Leave a Comment

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

Older Posts »