tag:blogger.com,1999:blog-3554166144204741789.post4878686763203342235..comments2023-12-31T02:16:32.747-08:00Comments on 1-800-MAGIC: Random permutationsSergey Solyanikhttp://www.blogger.com/profile/03811112928687191837noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-3554166144204741789.post-88614220003442007052008-02-27T19:51:00.000-08:002008-02-27T19:51:00.000-08:00rand() % i doesn't output 0..i-1 with equal probab...rand() % i doesn't output 0..i-1 with equal probabilities ... you need to use a different method.loser2007https://www.blogger.com/profile/11530937349997805374noreply@blogger.comtag:blogger.com,1999:blog-3554166144204741789.post-15394459149607326452008-01-29T09:25:00.000-08:002008-01-29T09:25:00.000-08:00That's one Google interview question I forgot (eve...That's one Google interview question I forgot (even though it's a nice one) - maybe perhaps I was only asked it once during my 9-interviews (eventually failed) process at Google. The one I didn't forgot involve Bloom filters, which I was asked about twice - either I'm lucky, or it gets used ALOT in Google.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3554166144204741789.post-38120785655891904032008-01-25T11:08:00.000-08:002008-01-25T11:08:00.000-08:00Thank you - fixed!Thank you - fixed!Sergey Solyanikhttps://www.blogger.com/profile/03811112928687191837noreply@blogger.comtag:blogger.com,1999:blog-3554166144204741789.post-74853220697970141982008-01-25T00:24:00.000-08:002008-01-25T00:24:00.000-08:00Good article, but misprint presents at the knuth_s...Good article, but misprint presents at the knuth_shuffle:<BR/><BR/>...<BR/>for (... ++i) // <= Should be --iAnonymousnoreply@blogger.com