News for hackers. Stuff that matters.
Re:Bootstrapping My Side Project to $6k/Month by always_good on Thursday November 16, 2017 @11:21AM (#15713860)
I can agree with Jonathan Blow's responses in so far that you should be able to invert a binary tree in an interview if that's the sort of knowledge you need on-call on the job and there's somehow no room for rustiness because it's some sort of high stress environment that needs immediate results (btw that doesn't describe jobs at Google).

But then he reveals that he's completely full of himself when he suggests that "sorry, you're not a good programmer then."

Re:Bootstrapping My Side Project to $6k/Month by johannes1234321 on Thursday November 16, 2017 @11:51AM (#15714187)
For writing non-trivial software basic knowledge of data structures is needed. Especially with performance requirements like Google has. In some areas you get away without such knowledge but if you bild a dependency management tool like brew and don't know what a tree is, this is suspicious.

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.

Re:Bootstrapping My Side Project to $6k/Month by always_good on Thursday November 16, 2017 @01:30PM (#15715195)

    > 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.

Re:Bootstrapping My Side Project to $6k/Month by johannes1234321 on Friday November 17, 2017 @06:37AM (#15721154)
Well, inverting is a trivial operation, pseudo-implementation: swap(left, right); recurse(left); recurse(right);

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)

Re:Bootstrapping My Side Project to $6k/Month by innocentoldguy on Thursday November 16, 2017 @03:29PM (#15716307)
Isn't the typical practice amongst software engineers, when you don't know something off the top of your head, to cut and paste from StackOverflow? Why do we need day-long job interviews and whiteboards to ascertain that?
Re:Bootstrapping My Side Project to $6k/Month by opmac on Thursday November 16, 2017 @11:31AM (#15713972)
The name "Jonathan Blow" and the words "full of himself" pretty much go hand-in-hand.
Re:Bootstrapping My Side Project to $6k/Month by tomp on Thursday November 16, 2017 @11:34AM (#15714008)
Haha, I've been a programmer for most of my life and I don't know what "inverting" a binary tree even means!
Re:Bootstrapping My Side Project to $6k/Month by guessmyname on Thursday November 16, 2017 @11:44AM (#15714109)

            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
Re:Bootstrapping My Side Project to $6k/Month by tomp on Thursday November 16, 2017 @05:52PM (#15717443)
Ah, I would personally call that "flipping", I kind-of imagined that "inverting" would mean maybe taking a node and putting in the root of the tree or something similar...
Re:Bootstrapping My Side Project to $6k/Month by mullen on Thursday November 16, 2017 @12:23PM (#15714522)
Why would you want to reverse/inverse a binary tree?
Re:Bootstrapping My Side Project to $6k/Month by sushid on Thursday November 16, 2017 @02:43PM (#15715855)
It's an easy way to check if you can think recursively/are familiar with a btree.
Re:Bootstrapping My Side Project to $6k/Month by hinkley on Thursday November 16, 2017 @12:00PM (#15714271)
That’s reversing a binary tree.
Re:Bootstrapping My Side Project to $6k/Month by guessmyname on Thursday November 16, 2017 @12:13PM (#15714417)
Re:Bootstrapping My Side Project to $6k/Month by hinkley on Thursday November 16, 2017 @05:14PM (#15717172)

    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.

Re:Bootstrapping My Side Project to $6k/Month by nathan_f77 on Thursday November 16, 2017 @12:42PM (#15714688)
That was fun, thanks! I remember reading that tweet a while ago, and "inverting a binary tree" sounded very complicated, but it's really just one line of code.
Re:Bootstrapping My Side Project to $6k/Month by nnd on Thursday November 16, 2017 @04:24PM (#15716764)
I'd be very careful now, you might not be a REAL programmer.