> The same was true for java's binary search
I used to ask "implement binary search" as an interview question and gave up on using it because not a single candidate could do it correctly in 45 minutes. This was at a FAANG.
I used to ask "implement binary search" as an interview question and gave up on using it because not a single candidate could do it correctly in 45 minutes. This was at a FAANG.
If they didn't, than I believe you did a poor job of guiding them. I refuse to believe that this is some esoteric, tough question. If you can solve dynamic programming problems, you can easily solve this one.
(high + low) / 2
To
Low + (high - low) / 2
What else about this problem is a "sharp edge"?
Candidate: bsearch(key, base, num, size, compare_fn);
Me: "Your offer should arrive within one to two weeks. Need any help with relocation expenses?"