Student intern with Microsoft test questions
I was made aware of a few test questions that Microsoft ask as a first process to applicants on their student intern program. It's great to see these being asked and I figured I'd post up some pointers to help folks answer them as best as they can.
How do you test your code?
Answer should be "as much as possible" then explain how. If your a TDD fan then you can explain that and how you use it. If Waterfall, V-Model, RUP, CA and others are more your thing then explain how specification levels and testing meet. Either practice means testing and Microsoft will be interesting in hearing how you test. Don't lie however, your interviewer is likely to ask you about this question and if you know nothing about it then it will quickly show. Got tests on your project? Great explain a little about that, as a feeder for your interview.
Given a simple program designed to take inputs of integers from 1-1000 and to output the factorial value of that number, how would you test this program? You do not have access to the code. Please be as specific as possible
Note your not being to ask to code this question but consider first off what considerations you need to take before you answer the question. So given that the factorial number is any number that is 0 or above and the result of products of each number set you have 1 input and 1 output. So test fail conditions would be any negative numbers, 0 input value and a output value of 1, and incorrect results from a valid (0 or greater) input. Test pass conditions should test that a input of 0 equals a output value of 1 and that it take in every number bewteen 0 and 1000 and the expected result. You are testing every single range possible but the you run the risk of false postives raising from typos and other mistakes in such a big range of data. You could snapshot say 100 numbers that sample a different range and variance between 1 and 1000, this does mean that we can vary the number input range from each test to the next and prehaps expose errors.