3 ms·
The point of that exercise seems to me to make people implement binary search without having a solution they have learned by heart.
by kkjjkgjjgg 5y ago
The point of that exercise seems to me to make people implement binary search without having a solution they have learned by heart.
- cloverich 5y agoWell, yes but my supposition is that it will trip some people up in unexpected ways. And given a tight timeline, the results will not translate into how good of a programmer they are. IMHO it will be semi-random whether good programmers can complete the problem. And of those that can, a sub-set will have (whether they recall it or not) completed VERY similar problems in the past. I've found a great number of "easy" problems too challenging to complete in 45 minutes. And yet once I learned the underlying techinques / DS / Algo's, many "medium" ones I can complete in 10 minutes or less, even when I have not seen that particular problem. Conversely, I was able to complete some of the harder problems in 5-10 minutes without EVER having seen the underlying algorithms before, because I actually had in real life problmes but had never drawn the connection. The more leet code I do, the more I realize when encountering a new problem, it is a complete roll of the dice if it will take me five minutes or five hours, despite being of the same level of difficulty and even same class of problem. But this is not so surprising -- this is how the history of those algorithms unfolded. Many were one line of code away from a far better runtime, and sat for years before someone cracked it. My main take away is, algorithmic style questions can be useful to test whether candidates adequately prepared and practiced from a given set of information, and is perhaps most predictive of their level of comittment / professionalism / base-aptitude. IMHO unless you are building a novel product or charting unknown territory (rare), its far better to be experienced, prepared, and well read, than it is to be smart. Perhaps. I don't take issue with Google requiring a wide variety of expertise in such problems to get in. I do have a problem with a random set of "easy" problems and then making judgements of people afterwards. But that's just IME.