News for hackers. Stuff that matters.
Re:Reservoir Sampling by wood_spirit on Thursday May 08, 2025 @02:52PM (#43929899)
Interesting idea, hadn’t that about that way to apply it.

I knew it from before my interview from a turbo pascal program I had seen that sampled dat tape backups of patient records from a hospital system. These samples were used for studies. That was a textbook example of it’s utility.

Re:Reservoir Sampling by dekhn on Thursday May 08, 2025 @03:15PM (#43930183)
I guess the question in my mind is: would you expect a smart person who did not previously know this problem (or really much random sampling at all) to come up with the algorithm on the fly in an interview? And if the person had seen it before and memorized the answer, does that provide any signal of their ability to code?
Re:Reservoir Sampling by samwho on Thursday May 08, 2025 @05:07PM (#43931375)
My gut instinct is no. I certainly don't think I'd be able to derive this algorithm from first principles in a 60 minute whiteboarding interview, and I worked at Google for 4 years.
Re:Reservoir Sampling by wood_spirit on Friday May 09, 2025 @12:17AM (#43933742)
They wanted to see your analytical thinking skills at work. To pass you only needed to be sensible. You didn’t fail the interview if you couldn’t invent reservoir sampling!
Re:Reservoir Sampling by dekhn on Friday May 09, 2025 @12:16PM (#43938480)
uh, no, people would get a fail on the question if they didn't correctly identify both the initial selection and sample acceptance criteria.