4 ms·
I'm a data scientist, and google asked me to sum all values of nodes at each height of a tree. I had to implement the tree, bfs, and the algo (which was easy o
by autokad 8y ago
I'm a data scientist, and google asked me to sum all values of nodes at each height of a tree. I had to implement the tree, bfs, and the algo (which was easy once you have bfs) in a 25 minutes, minus any talky time.
BFS is not something I thought about much in the last 5 years, and quite frankly could care less about. I got stuck when I knew I needed 'something' to finish implementing BFS, but couldn't remember and the google interviewer offered no help. What I couldn't remember was the queue.
- alasdair_ 8y ago>I'm a data scientist, and google asked me to sum all values of nodes at each height of a tree. I had to implement the tree, bfs, and the algo (which was easy once you have bfs) in a 25 minutes, minus any talky time. THIS is the problem. The (unreasonably) timed nature of the exercise means that the only people that will do well are the people that prep heavily for this specific skill, in much the same way that people about to take the LSAT are likely to do better than it than actual fucking lawyers with proven experience.
- rossdavidh 8y agoTime (and being watched) do make it very unrealistic, but the other thing missing is that programming now is not like in the 1970's, you don't need to memorize much of anything. If you forget something, you look it up, it takes 30 seconds to remind yourself, "oh, yeah, the queue", and then you go. Testing if you can do it without looking it up is not testing the skills you actually need in order to code well.
- lr4444lr 8y agoNow take this analogy one step further: why aren't lawyers asked stupid timed LSAT questions at every job interview? Because they take a really challenging professional exam called the bar, which is a strong base level guarantee of actual knowledge and competence. Software Eng. have been fighting this kind of credentialing because somehow tech is "top innovative" for such standards. Hence the status quo, and why companies like TripleByte see opprtunity.
- barry-cotter 8y ago> Now take this analogy one step further: why aren't lawyers asked stupid timed LSAT questions at every job interview? Because which law school they went to is on their resumé and the average LSAT scores for each school are trivially available, tracking very, very closely with school prestige.
- deleted 8y ago[deleted]
- username90 8y agoYou don't need bfs to do that, you can solve it with any kind of tree traversal by just keeping track of which level you currently are on and passing a pointer to the result vector. If you can't write a tree traversal implementation within 25 minutes then I don't really know what to say.
- autokad 8y agoyou are right about any tree traversal would have done, but its not a lot of time and if you end up stuck you dont have a lot of time to backtrack. a lot of great data scientists dont even know how to use python, let alone implement a tree and tree traversal. there is so much more interesting and pertinent stuff I spend my cycles on learning / keeping in my head than undergrad cs bs.
- grdyhrdy 8y agoThey didn't let you "Google" it at Google? Something wrong there.