Return a random object from the stream

Suppose you have a stream object. This stream object ONLY has two methods. They are:
HasNext() - returns a boolean if there are more items in the stream
GetNext() - returns the next item in the stream
Given a stream such as this one, return a random object from it. No, the stream cannot be reset.

top 5
43 months ago
Small pic dmc binary stream

This challenge has received 29 submissions
Top 5 share $75
$15.00 Square pic hoa3 University of California at San Diego
$15.00 T University of Michigan
$15.00 R Rochester Institute of Technology
$15.00 Square pic a17f956af0cc98ef09029fe181a1d598 Wesleyan University
$15.00 Square pic befunky underpainting 1 University of Toronto
Contact Us!
Write for our Blog to share your thoughts, ideas and stories with 300,000 peers