News for hackers. Stuff that matters.
Re:Do We Worship Complexity? by err0ne on Tuesday October 16, 2018 @11:09PM (#18235828)
I would have failed you as well. The point is to test whether you have a clear picture of what goes on one layer of abstraction below or if you are confined to the surface.

I don't get the fuss about interviews. They seem to largely consist of basic programming exercises.

You don't need to know the solution before hand and it is easily intuited on-the-fly. I would never hold it against someone to miss some corner-cases or maybe go for a naive implementation first.

I remember a few years ago, someone was complaining that they had been rejected for not being able to reverse a binary tree even though they had a copious amount of OSS.

The thought process is simple and it's an exercise that students do within the first few weeks of their freshman year.

    (struct node (value left right))

    (define (reverse-tree root)
      (cond
        [(equal? root 'EMPTY) root]
        [else
             (node (node-value root)
               (reverse-tree (node-right root))
               (reverse-tree (node-left root)))]))
    
A tree is intuitively defined as a recursive data-structure.

There is one base case: when we reach a leaf.

We want to reverse the left and right subtree at every stage of recursion.

Combine all of this and it's done. I would even be content with a pseudo-code implementation.

Re:Do We Worship Complexity? by vvanders on Wednesday October 17, 2018 @12:10AM (#18236071)
I would have given a +1 for creativity. If the interviewer didn't say that standard libraries were off bounds that's fair game IMO.

I've asked similar questions and if I forget all the constraints just a simple, hah that's clever + reframe the problem is a reasonable approach and doesn't come off as being a jerk(keep in mind the candidate is interviewing you/company as well).

Re:Do We Worship Complexity? by err0ne on Wednesday October 17, 2018 @12:43PM (#18240861)
"Implement a method that shuffles a list" vs. "Shuffle a list"

I would want the candidate to ask me whether they can use their language's standard library. I would say no/yes depending on how the question is framed.

The absolute worst is when question is framed like 1) - the candidate just makes an unwanted assumption, and then acts outraged or smug when I tell them I expect them to demonstrate that they aren't oblivious to the underlying implementation.

Then we venture off whether they can make improvements/trade-offs if the list becomes 10K, 1MM, 1B, etc. records of N bytes etc.

Re:Do We Worship Complexity? by exabrial on Tuesday October 16, 2018 @11:15PM (#18235857)
I'm much more concerned if the candidate is a person that shows up on time, with a good attitude, takes heat and shares credit, builds people up and isn't afraid to speak their mind. If they have a rudimentary understanding of the time constraints of linear vs constant time that's a bonus, otherwise I could teach them that.
Re:Do We Worship Complexity? by xyrouter on Tuesday October 16, 2018 @11:58PM (#18236027)
I come across candidate A who shows up on time, with a good attitude, takes heat and shares credit, builds people up, isn't afraid to speak their mind and offers a smart-ass answer to a problem designed to evaluate whether the candidate understands the underlying concepts.

Then I come across candidate B who shosw up on time, with a good attitude, takes heat and shares credit, builds people up, isn't afraid to speak their mind and offers a genuine and insightful answer to a problem designed to evaluate whether the candidate understands the underlying concepts.

I am definitely going to hire candidate B.

Re:Do We Worship Complexity? by sgift on Wednesday October 17, 2018 @03:13AM (#18236830)
And where did they give a "smart-ass answer"? A question was asked, an answer was provided. Does the answer solve the problem? Yes. If you want to know more then ask. If you want to hear something else that's a failure of the interviewer, not the interviewee.
Re:Do We Worship Complexity? by BurningFrog on Wednesday October 17, 2018 @12:54AM (#18236219)
But all this amounts to trivia questions about things you would never actually do or have to know when working as a software engineer.

The point of a library function is that I don't have to worry about how it works, so I can focus on writing things that are not already in libraries!

Re:Do We Worship Complexity? by flukus on Wednesday October 17, 2018 @02:51AM (#18236729)
> The point of a library function is that I don't have to worry about how it works, so I can focus on writing things that are not already in libraries!

The point of a library function is so it doesn't have to be re-implemented everywhere, not so you can be oblivious to how it works. If your oblivious to what is going on behind every function call you will write terrible code.