Thursday, November 8, 2012

Select a number from a stream with uniform probability

Here the code. the tricky part is the uniform probablity and the stream, which should be ideally processsed with O(1) memory


  1. Agree with Claudio. Funny that I failed this question in the homework assignment during the application process for a position in Bing! :)