Live data from Hacker News

Ask HN: What % of your job interviewees pass FizzBuzz type questions?

news.ycombinator.com

91–100 of 120 posts

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#91
post #70
post #61

Earlier quoted context omitted.

My point was, his questions, doesn't really indicate if the candidate is a good programmer or not. It could be the person studied up on all sorts of puzzles and famous algorithms online but hasn't really written or programmed anything. Not all jobs require that much expertise. You could be doing some really simple programming work. I think most interviewers ask these type of questions 1.) make themselves feel smart 2…

@eropple So do you have data to back up your claims that; answering those questions determine if your a good programmer. Yes, there are tons of programming jobs out there, that don't require much of those skills. Not all jobs are that innovative. Most of the development jobs I have seen require you to come up to speed with the code base fast. So it's that code reading comprehension that I think is most prevalent.

Part of our interview process is having the candidate code-review some really bad code. The only problem with it is that it is biased against students/recent graduates. I'd say close to 90% of student/recent grad candidates do pretty poorly on the code review question.

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#92
post #89
post #35

Earlier quoted context omitted.

Oops, although this won't help your mind ^_^, the correct expression is "... out of a wet paper bag". From more apropos usage about fighting or escaping from such a flimsy thing. And now that you mention it, I have no idea either ^_^ ... except that it ought to be easy. In that last company where I was part of the hiring process I myself got the job only because I was the only one they interviewed who could pass thei…

Maybe if there was a robot to program, I guess that would count.. now that would be a great opening move on part of the company! :D Let's see.. you'd have to get the robot into the right position (maybe find it with sensors - what kind of wet paper bag are we talking about, the dark kind?) and control another part that's capable of ripping the bag. Depending on the size of the robot you'll have to move it around a lo…

Well, you know, MIT's introductory EECS course is now Python programming of robots, so as soon as those students start graduating ^_^....

Thanks for calling me on this rather mixed metaphor I've been using for a long time in a most amusing way. You're brightened my end of the week.

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#93
post #54
post #49

Earlier quoted context omitted.

@aplusbi Let's say I interviewed you. I had asked to implement the fastest algorithm to give back the largest palindrome of words in English dictionary and compare it the largest palindrome of the french language. What the best solution you can come up with in 45 minutes. After, that I asked you, write a simple ftp server, in the language of your choice. With your first solution, I asked you implement a SSL library a…

His first question is very straightforward if you've ever encountered permutations in a math class (and you should have, if you're a programmer). Even if you haven't, it shouldn't be that difficult. His second is trickier, but solvable. And, no, I've never seen that (particular) question before.

Interesting. I'd find the permutations one trickier, and yes I've encountered permutations in math and have been a programmer a long time). Here's why I'd find it tricky.

There is an obvious recursive algorithm, but I'd be worried that if I gave that the interviewer would quibble about stack usage (although it is going to be linear in the number of items being permuted which should be OK most of the time).

Thinking a bit more, I can see that it should be possible to do an iterative algorithm that needs little or no state other than the last permutation generated and that given a sorted input string would generate the permutations in lexicographic order. The basic idea is that if you partition the string into two parts, AB, such that no permutation of B exists that is lexicographically after B, then the next permutation of AB is formed by replacing B with the lexicographically first permutation of B, and then exchanging the last character of A with the first character of the new B. (I think that will generate them all, in order--but I've not seriously analyzed it--I'm just riffing off the top of my head as I type here, like I'd be doing in an interview).

OK, now I'd worry about that step of replacing B with the lexicographically first permutation of B. That can be done by sorting B, but then the interviewer might complain about all that sorting. Aha! The lexicographically last permutation of B and the first permutation or reverses of each other, and reversal can be done in O(n). (And maybe it can be done even faster with some kind of doubly linked list to store strings as list of elements, where a string is represented by a pointer into the list, a length, and a direction flag...something to think about).

Anyway, the permutation question is fraught with potential pitfalls. I'd be smart enough, I hope, to do all the above musings out loud to give the interview a chance to jump in and tell me "It's OK...I just want to see if you can write code, so go ahead with the recursive solution".

That second problem is straightforward. It's just binary search. The rotated array doesn't change anything fundamental about it--it just slightly complicates the check to see which half the target element must lie in. There will always be at least one "normal" half--that is, a half where all the elements are sorted. You can recognize a normal half be the left endpoint being less than the right endpoint. You check for the target in a normal half the usual way. If the target is not in the normal half you check, it must be in the other half (or not in the array at all).

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#94
post #68

Earlier quoted context omitted.

It's not about how expensive a laptop is or isn't. If somebody can't master the basic syntax of the language so that they can write a very basic algorithm without syntax errors and in such a way that it would run on the first try, they can't be very productive. And fizzbuzz is really the rock-bottom of the simple algorithms. Even a linked-list library would be a very reasonable thing to ask (if we're talking about C…

Writing on a whiteboard while explaining yourself is different from typing alone into an IDE. Conventions you might use to avoid syntax errors (like typing a pair of braces and then filling the middle) may not work on a whiteboard. Pacing is different, and muscle memory doesn't help. You're looking at a blank whiteboard rather than your terminal with other parts of the codebase. The first few minutes of coding are of…

I have never been in an interview for a job as programmer, to be honest, but really, we're talking about fizzbuzz here. You should be able to recite it in your favourite programming language. :)

For more complicated tasks I guess you can say it's debatable when whiteboard is OK and when you should give the candidate access to a computer.

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#95

Earlier quoted context omitted.

Give em a laptop. Those are a dime a dozen (we got a ton sitting around the office). Have em code in front of you. Hell I'd install any interpreter within reason to let em solve it.

Amen. Who writes code on paper in real life anyway? The font is wrong, there is no backspace and you can't insert and remove lines. Interviewers have some nerve demanding proper syntax. Give me a laptop with just a text editor and watch over my shoulder.

I'm not sure if you're sarcastic or not, but would you hire a programmer who can't compute "2+3" in his head? The same argument can be made for basic maths operations: we all have calculators (applications).

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#96
post #93
post #54

Earlier quoted context omitted.

His first question is very straightforward if you've ever encountered permutations in a math class (and you should have, if you're a programmer). Even if you haven't, it shouldn't be that difficult. His second is trickier, but solvable. And, no, I've never seen that (particular) question before.

Interesting. I'd find the permutations one trickier, and yes I've encountered permutations in math and have been a programmer a long time). Here's why I'd find it tricky. There is an obvious recursive algorithm, but I'd be worried that if I gave that the interviewer would quibble about stack usage (although it is going to be linear in the number of items being permuted which should be OK most of the time). Thinking a…

Interestingly enough no one I've interviewed has every suggested lexicographical ordering although I have implemented it that way myself to see how hard it would be (answer: it's kind of hard).

That said, C++'s standard library has a next_permutation function that returns the lexicographical next permutation of a pair of iterators (actually it does it in-place and returns a bool). If a candidate used that I'd allow it (as long as there was some discussion as to how it worked).

I've since stopped asking that question and now stick primarily with the split array question as I think it's less tricky. There's more than one way to solve it and most of the solutions build up on simpler solutions which makes for good discussion. I also don't ask for actual code for that problem unless I get the feeling the candidate will understand the problem better by expressing it in code.

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#97
post #88
post #75

Earlier quoted context omitted.

couldn't agree more. if i had to come up with a permutation algorithm as part of writing code, you'd better believe i'd look one up so that i'm sure i'm doing things optimally. i wouldn't trust myself to come up with the exactly right algorithm on the first try. if i had to deal with some weird half-sorted array, i assume i'd be working in the same context as the problem and wouldn't have to make up a solution on the…

These questions aren't about "real world" situations, they are about problem solving and basic coding. Questions are good, as is a discussion on how and why these things should be implemented. For the split array problem I rarely ask for code (only when I think it will actually help the candidate), it's just a discussion. It usually goes something like this: Candidate: Well I can sort it first, then do a binary searc…

You probably get a few false negatives out this, depending on how good you are at drawing people out. Some people would be thinking "this question seems easy enough that I should be able to solve it without asking dumb questions, but I'm so nervous I'm not thinking straight" and then just freeze up. You should be able to draw them out, though, as long as you're aware that the reason they're not answering is mostly because they're nervous. It sounds like you've done a lot more interviews than I have, so I'm sure you could handle it. It is harder when their facility with English is poor.

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#98
post #91
post #70

Earlier quoted context omitted.

@eropple So do you have data to back up your claims that; answering those questions determine if your a good programmer. Yes, there are tons of programming jobs out there, that don't require much of those skills. Not all jobs are that innovative. Most of the development jobs I have seen require you to come up to speed with the code base fast. So it's that code reading comprehension that I think is most prevalent.

Part of our interview process is having the candidate code-review some really bad code. The only problem with it is that it is biased against students/recent graduates. I'd say close to 90% of student/recent grad candidates do pretty poorly on the code review question.

What type of candidate are you looking for? Obviously recent graduates will not have that much coding experience and reading comprehension.

Are you looking for someone to write new libraries from scratch? Who can implement new algorithms and data structures from nothing. Someone who can write new protocols and publish it to the team?

Are you looking for someone who can read your code base? Just fix bugs?

This one problem I keep seeing, many software companies don't know what to look for. Everyone wants that "smart and gets things done", but do you what things need to be done?

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#99
post #88
post #75

Earlier quoted context omitted.

couldn't agree more. if i had to come up with a permutation algorithm as part of writing code, you'd better believe i'd look one up so that i'm sure i'm doing things optimally. i wouldn't trust myself to come up with the exactly right algorithm on the first try. if i had to deal with some weird half-sorted array, i assume i'd be working in the same context as the problem and wouldn't have to make up a solution on the…

These questions aren't about "real world" situations, they are about problem solving and basic coding. Questions are good, as is a discussion on how and why these things should be implemented. For the split array problem I rarely ask for code (only when I think it will actually help the candidate), it's just a discussion. It usually goes something like this: Candidate: Well I can sort it first, then do a binary searc…

You should highlight, recent college graduates. If someone does get hired to your firm, I hope the "real world" problems are just as interesting.

I actually like those type of algorithmic problems you highlighted. I am not sure, what it measures other than the recent graduate knew his/her data structures and read their MIT Algorithms books really well. Very few jobs do require knowing that fundamentals that in depth. Are we writing a Kernel, or a file system? Are we writing a new type of java collection.

The type of real world problems that in the class of the 2 problem solving problems you mentioned seem far in few, unless you writing something new, that really needs to be optimized in some way.

I think this is a real problem with computer science schools. It great to teach the absolute bare essentials. But I think schools should also teach some modern programming and not leave it on the kids to learn on there own.

College grads that know modern frameworks, Node, ROR, they know javascript and ruby really well. They have written some nice web apps. Those are the ones with the best job perspective. They have proven they can do the work.

I can understand if you were interviewing for the core google search team. Their optimization's make the company money.

Remember what Knuth said about optimization.

Re: Ask HN: What % of your job interviewees pass FizzBuzz type questions?

#100
post #77

That sort of thing specifically, never actually tested it. The last test I did help administer was for a VB+SQL job, and the first question was to write an example of a valid INNER JOIN. I'd say at maximum 25% of the candidates could do this. Improving SNR? I did once have a potential employer get me to do a time-limited online test. If you wanted you could always stick your questions into one of them, so you can at…

I think the reason you got so bad responses on the first question wasn't that they couldn't write the join statement but that they had heard the distinction between the different joins once in college and then never considered them again. I bet that if you had asked for an example of a sql code which would list all the employees born before 1980 along with the department they worked for and the name of the head of th…

But with a normalised database you couldn't the above without two inner joins (and it's still a trivial query that any competent dev for that sort of position should be able to dictate while driving, it's that easy).

Really, if you can't remember the difference between inner, outer, full and cross joins then you shouldn't be working with databases. Which was rather what the test showed us, frankly.

Post reply on HN