Re:Ask HN: How to lead a stable, happy career as a bad inter...
by User23 on Monday May 13, 2019 @09:38PM
(#19906004)
And leetcode is trivial. Think reverse a linked list or something. I used to ask candidates to implement binary search correctly and I stopped because nobody could do it on a whiteboard.
[ Parent
| on HN ]
Re:Ask HN: How to lead a stable, happy career as a bad inter...
by shrimp_emoji on Monday May 13, 2019 @10:46PM
(#19906366)
It's funny: if you asked me that right now, I wouldn't be able to do it. That knowledge was in my brain at some point, but it fell out. I can, however, implement a PR quad tree[0] (which is a trie and not a tree) which allows efficient coordinate search of a 2D space since that's what I've been doing most recently. I think that's more impressive, but it's not what you asked for so I fail the interview. :3
Re:Ask HN: How to lead a stable, happy career as a bad inter...
by animal531 on Tuesday May 14, 2019 @08:33AM
(#19908851)
For bonus points you can also implement an Octree.
Re:Ask HN: How to lead a stable, happy career as a bad inter...
by shrimp_emoji on Wednesday May 15, 2019 @03:14PM
(#19922707)
That would be for coordinate search in 3D spaces. :D
Re:Ask HN: How to lead a stable, happy career as a bad inter...
by User23 on Thursday May 16, 2019 @12:27AM
(#19926116)
It's fun how easy it is to program in higher dimensional spaces and how hard it is to think in them. Mathematical formalism is a superpower!
Re:Ask HN: How to lead a stable, happy career as a bad inter...
by User23 on Monday May 13, 2019 @11:45PM
(#19906621)
Yeah, that's how it appears it really works.
That said, the fundamental idea behind bsearch is toddler easy. It's interesting that such an apparently simple algorithm, namely start in the middle, pick left or right depending on the key, and repeat, is so challenging to code correctly.