In the interviews I did with Google, Facebook and others (mostly for fun, not profit) if I didn't know an algoithm from top of my head I typically could talk to the interview and discuss th problem and they'd point me in the direction. Sometimes those interviews are less about being able to remember the thing, but the thought process to get there.
Aside from that: Google clearly optimizes on not hiring too many bad people, but rather leave a few good candidates behind.
> if you build a dependency management tool like brew
> and don't know what a tree is, this is suspicious
They didn't say that they didn't know what a tree is. They said they couldn't invert a binary tree in the interview.It's a stretch to start suggesting that someone doesn't know their basic data structures because they failed some riddleware on the spot.
You can say that they aren't what google was looking for, but my problem comes when someone tries to dismiss another as a bad developer because of that.
If one doesn't know what is meant one can talk to the interviewer and get a hint about what is meant. It can be that the interviewer is bad and misleading, but usually they have some specific training, this seems unlikely as the candidate didn't complain about the interviewer but admitted he had no clue.
The follow-up question would probably be the question about the complexity, that is also trivial f you know fundamentals of big O notation, as one has to walk over each node.
It's hard to find a more trivial algorithms question. Algorithms are fundamental knowledge for programmers (other than script kiddies)
2 2
/ \ / \
/ \ / \
/ \ / \
1 3 3 1
/ \ / \ / \ / \
0 7 9 1 reverse >>> 1 9 7 0
/ / \ / \ / \ / \ \
2 1 0 8 8 8 8 0 1 2
/ \
7 7[1] https://leetcode.com/problems/invert-binary-tree/description...
This problem was inspired by this original tweet by Max Howell
There are many definitions of invert. This is relying on one definition that is jargon, and not widely agreed upon jargon at that.For a two or more dimensional “object”. Invert means to reorient the top and the bottom, while reverse swaps the left and the right.
The two only might mean the same thing with one dimensional data structures. For instance inverting a line of text might (ambiguously) mean reversing it. Or drawing it upside down. Or upside down and backward. But at least you would expect a clarification.
But then he reveals that he's completely full of himself when he suggests that "sorry, you're not a good programmer then."