3 ms·
It's not a complicated algorithm. It's one that people might even use in their every day life (the example I used to use is finding a name in a phone book, I gu
by 549362-30499 9y ago
It's not a complicated algorithm. It's one that people might even use in their every day life (the example I used to use is finding a name in a phone book, I guess that's pretty dated now). I still see candidates who seem to have a conceptual understanding of it fail to translate it into code. That's why I ask it, it's a very simple "here's a thing that intuitively makes sense, now formalize it" question. Maybe this question rules out people who can only copy existing patterns and change values within them, but that's fine as far as I'm concerned. I don't want to hire engineers who can only mimic.
- Retra 9y ago> I don't want to hire engineers who can only mimic. How is a binary search not mimicry? Probably only 1 in a million people could figure out how to do it if they didn't already know how it is done elsewhere. The only reason most people know how binary search works is because they were taught it somewhere along the line. Ask an interviewee how to Voronoi diagram the surface of a sphere or something. Then you'll see how things look when people don't do mimicry. You don't get original ideas by asking first-semester programming puzzles.
- Banthum 9y agoI'm pretty sure I independently invented binary search when I was a child (as have many others). It's a pretty darn obvious thing to do when you're physically handling an ordered collection of records.
- Double_a_92 9y agoIt's actually just how you would find a number in a paper phone book.
- Retra 9y agoNo it's not. Some parts of a phone book search resemble a binary search, but choosing your pivot and processing the last few pages do not. I've never seen someone not do a linear scan at some point. But all that's irrelevant to my point. Asking for a bog-standard solution to an industry-standard question is in no way a demonstration of someone's originality. You don't ask it to prove that they aren't doing "mimicry" you ask it to prove that they can, and thus are capable of learning the basic tools of their trade from others.
- ThrowawayR2 9y ago> Probably only 1 in a million people could figure out how to do it if they didn't already know how it is done elsewhere. They already know how it is done elsewhere; it's how one finds a word in a (paper) dictionary or an book index.