3 ms·
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
by err0ne 8y ago
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.
- exabrial 8y agoI'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.
- xyrouter 8y agoI 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.
- sgift 8y agoAnd 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.
- vvanders 8y agoI 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).
- err0ne 8y ago"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.
- BurningFrog 8y agoBut 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!
- flukus 8y ago> 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.