3 ms·
I was asked to implement a random number generator in an interview not too long ago. This article should help...
by dunefox 5y ago
I was asked to implement a random number generator in an interview not too long ago. This article should help...
- FabHK 5y agoTerrible interview question, imho.
- dunefox 5y agoNot the only terrible one.
- actually_a_dog 5y agoI hope you were allowed to use some sort of reference material. Unless your previous work involved intimate familiarity with PRNGs, I would never expect anybody to be able to implement one on the spot, off the top of their heads. Even with reference material, I don't think I'd expect anything more involved than a linear congruential generator. Without reference material, probably the best I could do would be to read from one of the /dev/*random devices. I'm guessing that whatever the actual intention behind that question is that writing a function that essentially reads from a file doesn't match the expectation of the interviewer. :/ https://en.wikipedia.org/wiki/Linear_congruential_generator https://en.wikipedia.org/wiki/Linear_congruential_generator
- dunefox 5y agoNo, no material, no background, just an interview with live coding for an entry level position because my minor was in computer science. "One out of a possible 1k algorithms" - half a dozen were asked.