5 ms·
> there are many ways in which the question may be unclear and the interviewer is mislead that the applicant can't answer. yeah, when I was interviewed for my
by user24 16y ago
> there are many ways in which the question may be unclear and the interviewer is mislead that the applicant can't answer.
yeah, when I was interviewed for my university, they asked me to design an algorithm to work out the n'th term of the fibonnacci sequence. They repeatedly said I didn't need to use recursion or loops.
When I finally gave up, they said: well here's one way:
f(n) = f(n-1)+f(n-2)
I just looked at them and quietly said "well... yeah... I mean... obviously". By that point I was too depressed to say "but that's frickin' recursive, wtf?!?" but that's what I was screaming in my head.
Amazingly I still got offered a place.
edit: still bugs the crap out of me. Did I mis-hear them? Were they being deliberately misleading? Was it some kind of test to see how I reacted to an impossible problem[1]? Were they really expecting me to come up with some mathematical algorithm to calculate the nth term without recursion or looping? Argh!!!
[1]: actually it's not impossible: http://mathworld.wolfram.com/BinetsFibonacciNumberFormula.html http://mathworld.wolfram.com/BinetsFibonacciNumberFormula.ht...
but I don't have a background in mathematics and they knew that.
- ntoshev 16y agoThey were likely trying to help you and wanted to say they don't care whether you write an iterative or recursive solution.
- user24 16y agoI'm pretty sure I asked for clarification several times... It's possible I suppose. Here's the problem it started from: Eleven lily pads are numbered from 0 to 10. A frog starts on pad 0 and wants to get to pad 10. At each jump, the frog can move forward by one or two pads, so there are many ways it can get to pad 10. For example, it can make 10 jumps of one pad, 1111111111, or five jumps of two pads, 22222, or go 221212 or 221122, and so on. We'll call each of these ways different, even if the frog takes the same jumps in a different order. How many different ways are there of getting from 0 to 10? (source: http://www.comlab.ox.ac.uk/admissions/ugrad/Sample_interview_problems http://www.comlab.ox.ac.uk/admissions/ugrad/Sample_interview...)