 |

08-12-2002, 12:08 PM
|
|
Junior Contributor
|
|
Join Date: Sep 2001
Location: Washington, D.C.
Posts: 302
|
|
Interview Question
|
I have been using a particular question when interviewing developers for a while now and I've just been told that it's too hard a question. I totally disagree and think it's a basic concept that everyone should understand and be able to answer relatively quickly. Do you think it's unfair to expect an applicant for a Junior Software Engineer to do the following?
Implement a function accepting n and returning n! and it must be implemented recursively.
(It's not supposed to be an 8th grade math test so I willingly provide the definition of n! and provide 0! to 5! as examples to eliminate potential embarrassment.)
All I'm attempting to do is see if they can actually program and if they understand the concept of recursion. Anyone think this is an unfair expectation for a Junior Software Engineer? (Most are straight out of 4 years of college)
|
|

08-12-2002, 12:15 PM
|
 |
Disillusioned Code Poet
Retired Moderator * Guru *
|
|
Join Date: Apr 2002
Location: Tennessee, USA
Posts: 12,808
|
|
|
That sounds perfectly reasonable to me, and is in fact quite a bit simpler than the programming challenges I have been given in interviews.
|
__________________
Laura
Ita erat quando hic adveni.
|

08-12-2002, 12:20 PM
|
|
Junior Contributor
|
|
Join Date: Sep 2001
Location: Washington, D.C.
Posts: 302
|
|
|
Thanks lebb, his main complaint was the demand of implementing it recursively. I've been trying to think of another non-recursive question, but it's difficult to find something that's sufficiently hard enough to make sure they can actually program but sufficiently easy enough so that they aren't sitting in my office for two hours trying to figure it out. If you've got any suggestions that are a good balance between the two I'd love to hear them.
|
|

08-12-2002, 12:27 PM
|
 |
Junior Contributor
|
|
Join Date: May 2002
Location: Guess! It's really HOT!!
Posts: 314
|
|
|
I think the question is fine, it may be the way you phrase the question to the applicant, that gets them confused?
after all a recursive function is just a function that keeps calling it self (looping) until a condition is met. I would think that these college graduates would know this, but maybe not!
|
__________________
He who laughs last...Thinks slowest.
|

08-12-2002, 12:29 PM
|
 |
Code Meister
Retired Moderator * Guru *
|
|
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
|
|
Much as I like recursion, you don't see too much of it outside of school. In production environments, the possible problem of a "stack overflow" reduces it's utility.
I wrote a simple function in Tutors Corner that might do the trick...
The title is "Recursively searching a Directory" but that code was lost in the forum shuffle. Instead, I had a NON-recursive version. You can ask them to write something like that:
http://www.xtremevbtalk.com/show...6990#post16990
|
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
|

08-12-2002, 12:32 PM
|
|
Junior Contributor
|
|
Join Date: Sep 2001
Location: Washington, D.C.
Posts: 302
|
|
|
My wording is intentional. In the interview, my desire is not to teach recursion, but to tell them how I want it implemented and see if they understand. For example, if I wanted them to solve the problem with counter controlled loop, I wouldn't want to explain what a counter-controlled loop is.
|
|

08-12-2002, 12:36 PM
|
|
Junior Contributor
|
|
Join Date: Sep 2001
Location: Washington, D.C.
Posts: 302
|
|
|
Thanks BillSoo, I do have that internal debate. It's kinda contradictory I suppose, in that, if they were ever required to implement n! "by hand" I'd be pretty ****ed if they implemented it recursively. On the other hand, asking them to traverse a BST is a bit more than I want to wait for in an interview. I just think it's a nice clean problem, that's relatively easy to implement.
|
|

08-12-2002, 12:37 PM
|
|
Iron-Fisted Programmer
Retired Moderator * Guru *
|
|
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
|
|
|
I agree it is a reasonable question, difficulty-wise, but my opinion
is recursion is only useful in specialized situations. By using a
question like this you might be implying that you expect
programmers to use it anytime it could be used, most of which
would create slower, more inefficient code. Now if this is just one
of many questions, and they otherwise get all the other ones
correct, you might still consider them for a junior position on the
condition they learn how (and when) to use recursion.
As to an alternate question, I think it should relate to the kind of
programming that they would normally be doing. For instance, if
the type of programming requires alot of string manipulation, then
a function that receives a string (and possibly some other params)
and returns a substring (making use of InStr, Mid$, etc.). If the
main programming is numeric calculation based, make the correct
function very dependent on proper variable types, including them
having to select the right types for the size and precision of the
params and result you need. If database programming is involved
make sure they have a clue about using SQL.
|
|

08-12-2002, 10:01 PM
|
 |
Junior Contributor
|
|
Join Date: Apr 2002
Location: Newcastle
Posts: 289
|
|
|
i dont see anything wrong with it and i am by no means qualified as a programmer
|
__________________
As technology develops, so does our imagination
|

08-12-2002, 10:12 PM
|
 |
Code Factory
Retired Moderator * Expert *
|
|
Join Date: Jan 2001
Location: Montreal, Ca.
Posts: 5,565
|
|
|
I was interviewed last week, 50 questions, most all were theory (very advanced) and very few had code.
I wish there was more coding on the quiz simular to yours (quwiltw)
|
Last edited by Robby; 08-12-2002 at 10:37 PM.
|

08-13-2002, 06:40 AM
|
|
Just another Excel nerd
Retired Moderator * Guru *
|
|
Join Date: Feb 2000
Location: Michigan, USA
Posts: 2,624
|
|
|
I think that the question is fine, but I agree with Bill and Thinker that recursion is mostly just used in college. Plus, if you don't want them to use recursion while they're actually working for you, it seems a bit odd.
You could ask them to write some somewhat simple procedures, such as:[list=1][*]Write a function that takes a string as a parameter and returns the reverse of the string.[*]Write a function that takes a string as a parameter and determines if it is a (sorry, brain-freeze)... if the word reads the same forward and backward.[*]Write a simple encryption or sorting algorithm.[/list=1]
|
__________________
"The face of a child can say it all, especially the mouth part of the face." - Jack Handey
|

08-13-2002, 07:43 AM
|
|
Junior Contributor
|
|
Join Date: Sep 2001
Location: Washington, D.C.
Posts: 302
|
|
Quote:
|
Plus, if you don't want them to use recursion while they're actually working for you, it seems a bit odd.
|
I didn't say that. I said I wouldn't want them to implement n! recursively. I *would* want them to know when a recursive solution was appropriate. There are a number of cases, such as when the data structure is naturally recursive (ex. tree-like) where it's a obvious fit. As I said, the only reason I use n! in my test is because it's simple, clean, and quick. Asking an applicant to do a traversal of an AVL tree (something more realistic) using recursion is a bit too much for an interview methinks.
BTW, It's called a palindrome and I like that one, I think I'll use it.
Thanks,
|
|

08-13-2002, 07:45 AM
|
|
Just another Excel nerd
Retired Moderator * Guru *
|
|
Join Date: Feb 2000
Location: Michigan, USA
Posts: 2,624
|
|
Quote:
Originally posted by quwiltw
BTW, It's called a palindrome and I like that one, I think I'll use it.
|
Thanks. It's been one of those days. LOL
If you want to make sure that they know about the concept of recursion, then I think it's an excellent question because it covers the most basic aspects of recursion (what to do in your base case, what to do otherwise) without needing a whole lot of extra brainpower.
|
__________________
"The face of a child can say it all, especially the mouth part of the face." - Jack Handey
|

08-13-2002, 07:50 AM
|
 |
Bit Flipper
|
|
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
|
|
Quote:
Originally posted by Mill
...Write a function that takes a string as a parameter and determines if it is a (sorry, brain-freeze)... if the word reads the same forward and backward....
|
That is what I was thinking, similar to our recent palindromes contest.
Orbity
|
|

08-13-2002, 07:51 AM
|
|
Just another Excel nerd
Retired Moderator * Guru *
|
|
Join Date: Feb 2000
Location: Michigan, USA
Posts: 2,624
|
|
Quote:
Originally posted by Orbity
That is what I was thinking, similar to our recent palindromes contest.
|
Exactly. It's bad to have a Monday kind of morning on a Tuesday.
|
__________________
"The face of a child can say it all, especially the mouth part of the face." - Jack Handey
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|