Microsoft Interview Question for Software Engineer / Developers


Country: United States




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

Using a distribution plotter.
For a random number generator in range [a,b]
Make a-b as y axis
Make function call number / time as x axis.
Make sure they don't look too concentrated in any given region.

- at November 13, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

That's not easy. I would look up a number of tests that a random number generator is expected to pass. There's all kinds of stuff. One simple one is to use it to generate random numbers that are, say, integers between 0 and 100, and make sure that the distribution of these numbers is even. You could do a chi-squared test to make sure any observed departures from an even distribution are not statistically significant.

- eugene.yarovoi November 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

generating one million numbers and making a graph out of it will help us to see the trend that the generator generates number in a random order or not. Also there are a lot of questions like does it generates -ve numbers? whats the range? i assume no fp numbers here.

- Upt November 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

no test can gurantee a random number generator to be truly random, as results are supposed to be random . a binary random number generator could still be good one if it gives 1 (from 0,1) all the million times.

Now that was theory, practically you have to first define some test criteia, like if you run n number of times then the diff in maximum and minimum count of result should not be more then n/10 etc

- abhishek November 12, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Let (x, y) represnting a point where x and y are generated by the random generator beween (a, b) seperatly. After getting enough points, we can draw a graph using the value pairs and check if the points are well-proportioned.

- liming November 16, 2011 | 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