8 ms·
Another thing about the algorithm and article is, this is supposed to be a "real world problem" that the interviewer asks because they're struggling with it the
by joe_the_user 13y ago
Another thing about the algorithm and article is, this is supposed to be a "real world problem" that the interviewer asks because they're struggling with it themselves. But what would a single randomly chosen item from a huge set mean to "real world" operations? That you would very occasionally get a very usual value? - You'd have to run the scan many times for that and whatever other thing you were thinking of.
Basically, the algorithm is "cool exercise in probability" that any deeper look will discover has just about zero use or practicality in the actual "real world". Which kind of throws into the zone of obnoxious interview brain teasers despite claims to the contrary.
- stouset 13y agoNot at all. The exercise is trivially extended to allow for selecting 1,000 or 1,000,000 items from the set. This can be useful if you want a reprsentative sample from the stream, but require a well-defined and limited number of samples.
- gizmo686 13y agoThe problem was supposed to be based off of a real world problem. Almost always, when you simplify a problem you have to its core, you end up with a very simple question that appears to have no practical applications. Normally, this simple question is also easy, in which case simplifing it is the only skill you need. In other cases this question is hard, in which case you need to be able to solve it. Both of these skills are valuable, but should not be tested in the same question. Also, if you are trying to pick a candidate's brains, their is no reason to make them redo your work of simplification, when you are stuck on the actual problem.