Re:Ask YC: Does interviewing developers leave you depressed?
by philwelch on Saturday August 08, 2009 @01:21AM
(#749002)
Dammit, I made a syntax error. The factorial function in C should be
int fctl(int n){ return ( (n == 1) ? n : n * fctl(n)); }
Re:Ask YC: Does interviewing developers leave you depressed?
by philwelch on Saturday August 08, 2009 @04:40PM
(#749776)
(n-1) for the recursive call. God, I'm failing this interview.
Re:Ask YC: Does interviewing developers leave you depressed?
by Flemlord on Thursday August 13, 2009 @03:44AM
(#760235)
Heh. Our actual interview question is similar but we ask them to add instead of multiply. We ask them to add up all positive whole numbers equal to or less than x. Good developers (who make it to the next round) bang out the answer in literally 30 seconds. Ok developers (who still make it to the next round) usually struggle for a while, maybe implementing it non-recursively first. The other 70% just type nonsense until I cut them off after 15 minutes.
If somebody makes a mistake I tell them and give them hints until they fix it. Well... it depends on the magnitude of the mistake I suppose. If they're not even in the right ballpark I keep my mouth shut.
Re:Ask YC: Does interviewing developers leave you depressed?
by anigbrowl on Saturday August 08, 2009 @04:37PM
(#749772)
Thanks for your considered and interesting reply. I agree that a discussion is much more informative (for both parties) than a rapid-reaction test, but with the rise of a speed-dating approach to business in recent years it's hard to know what people are looking for, sometimes.
Re:Ask YC: Does interviewing developers leave you depressed?
by philwelch on Saturday August 08, 2009 @06:26PM
(#749921)
Your better employers will thoughtfully talk with you though, and this is a good way for you to pick a good employer. That's an unseasonably optimistic attitude during this recession though.
The standard interview question is "write a function to solve this problem which has an elegant recursive solution", not "think of a recursive function". But if you do want to think of a recursive function, try factorial.
(Don't use that code in an interview. It's questionable style for C, and the ternary operator is scary to people.)I was asked to write a fibonacci function once, and I actually said, "you can do this recursively but the performance is awful" and wrote an iterative solution.
The point of an interview is for you to show off. If you start going on and on and on and on about unnecessary details the interviewer might stop you, but if you launch into a talk about the space and time properties of recursion vs. iteration and show some judgment for how to use recursion and how not to use recursion, then I know how knowledgeable you are.