Microsoft Interview Question
Senior Software Development EngineersTeam: Bing
Country: United States
Interview Type: In-Person
1. Random number => no predictable pattern in numbers generated => the diff between the nos should not be the same, etc
2. Each number in between 0-999 has to have equal probability of occurrence. So, we should maintain frequency counts and verify that no single number stands out w.r.t. frequency.
My answer:
- IntwPrep.MS January 17, 2014- verify that the frequency is distributed evenly for all the possible numbers
- Verify that the distance between repititions is about the size of the set (1000) for each number
- Verify that the distance between consecutive random numbers is random in itself
- Verify that the numbers 0-999 are only generated
- Verify that in each run you do not get the same sequence of random numbers. Seed it differently
- For visual identification of anomalies, plot the values (y-axis as random number, x-axis as each attempt)