Microsoft Interview Question for Testing / Quality Assurances






Comment hidden because of low score. Click to expand.
2
of 2 vote

This is a very tricky question. I think the question really tries to see if you include testability as factor when developing software. Having said that there are couple of ways to test this software
1. As a part of the random number make sure you can seed it so that the results are predictable. This is a good very to prevent your self from shooting in the foot.
2. Make sure generation of N numbers can accurately generate the desired quantity.
3. If the random number can specify bounds, make sure we can write a regression test to ensure boundary conditions.
4. If the random number should not be repeated, make sure that it is covered with a regression test case to get a good degree of confidence.
5. Random number generations can some times get really complicated, so try to load test the code to generate millions of values with different seeds to ensure it meets the desired response time
6. To ensure that the code is not using a specific os specific function , ensure testing it on different platforms (linux, win 98 etc.) if this is a application or test the code on multiple browsers if it is a webapplication

- VJ October 27, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 0 vote

Nice one VJ !

- Raj_Gator January 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1. Run the program n number of times and check if there are any repeatitions
2. Check the frequencey distribution of the random numbers

- Seshagiri July 24, 2005 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Interesting response. I think I meant "first n prime numbers" when I wrote that.

- Gayle L McDowell July 24, 2005 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1. Write a script of some sort to check to see if n numbers are in the result
2. Compare the result to some sort of reliable prime number generator to see if they are generating consecutive prime numbers
3. If n is defined in the spec give the value of n to be specified MIN (which may be 0 or 1), MAX (100 or something like that), MIN - 1, MAX + 1, a value between MIN and MAX
4. Also monitor the performance of the generator when you increase n from MIN to MAX. Usually it wont perform in a polynomial way, as checking for primality is NP-Complete.
5. Do stress testing (run it in a loop to uncover memory leaks if any)
5. Volume testing (Give a very large number, much greater than MAX mentioned in the specs)
6. Invalid inputs (-1,'A'...)

- srihari January 14, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If they are cosequetive prime nos. how are they random??

Random means there should be no pattern whatsoever.

- Andrew March 24, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This is actually an interesting question...
You can probably make sure it generates n numbers, not n-1, not n+1, etc.
But how can you test something that is random - can't be predicted?

- PP May 01, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Good point!
1. Check # is n;
2. Run several times to check the overall pattern by printing out as a graph;
Given some limit value,
3. Write an automate program to find the repeated data in each output, total # should be small;
4. Write an automate program to compare all outputs, same as above...

- James May 10, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This is a very tricky question. I think the question really tries to see if you include testability as factor when developing software. Having said that there are couple of ways to test this software
1. As a part of the random number make sure you can see it so that the results are predictable. This is a good very to prevent your self from shooting in your foot.
2. Make sure generation of N numbers can accurately generate the desired quantity.
3. If the random number can specify bounds, make sure we can write a regression test to ensure boundary conditions.
4. If the random number should not be repeated, make sure that is covered with a regression test case to get a good degree of confidence.
5. Random number generations can some times get really complicated, so we should try to load test the code to generate millions of values with different seeds to ensure it meets the desired response time

- VJ October 27, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

"How would you test program to generate first n random numbers" lol.
What are your graduation degrees folks? There are some GBs of papers testing randomness, I wrote one of them. :)
Please check en.wikipedia.org/wiki/Randomness_tests for initial ideas. Then get some ideas on Statistical Hypothesis testing.

- LOLer April 05, 2010 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More