Amazon Interview Question for Software Engineer / Developers
- 0of 0 votes
AnswersWhen i wasn't certain whether my random function generated with equal probability all permutations, the interviewer asked me to write a formal proof that it works or not and send it to him (really strange).
- Muhariz Jabeer May 24, 2006
Proved it with the following and he bought it:
Probabilisticly
card 1 has 52 positions it can fit in
card 2 has 51
card 3 has 50
so on and so forth
card 52 has 1 position to fit in
hence its 52 x 51 x 50 x ... x 1 = 52! can be generated using this shuffle.
Oblivious to me, aparantly this kind of shuffle is used a lot in online card games. Silly me :P| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Math & Computation
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.