Hacker News new | past | comments | ask | show | jobs | submit login

> I've had to work on tree traversal stuff multiple times in my life, anything low level GUI related will work with trees a ton.

How many times did you have to write tree balancing code with no reference materials?




Bingo. You forgot to add "with someone literally looking over your shoulder," though.

I've written AVL trees, B-trees, red black trees, and a bunch of other things people have named here. But, right now, without looking at any references, I couldn't even tell you how to balance an AVL tree, much less sit down and write out code for it.


That's why these interviews select for recent grads. Or leet code studiers.

Yes we've all done this in university. We've learned the theory. We had to write an implementation of this or that algorithm in whatever language the university made us use.

And we also know that great minds took a long time to come up with these in the first place. These "basic algorithms" are not something you think up in 5 minutes after first learning that computers exist or that some problem exists.

Bin packing algorithms are another such thing. Sure ask me interview "questions" like "please prove whether P=NP".

Eff off Mr. or Mrs. interviewer!


The exact same number of times I've been asked that during an interview: 0!

I do ask tree traversal questions when interviewing because I've had to traverse a lot of trees so I think being able to do an in order traversal of an already sorted binary tree (which is only a handful of lines of code) is fair game.


Just the once? [maths joke]


In order traversal is simpler and more practical than the questions xandrius asked about.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: