Brainbench perl test?
Avishalom Shalit
avishalom at gmail.com
Tue Sep 4 13:18:49 BST 2012
i disagree.
"Given that fib(n) is equal to fib(n-1) + fib(n-2) write a fib function in
any language"
is a well defined function ,
apart from the base case , that I would assume the applicant ask about
before coding an exploding recursion.
if you'd have calld it g() instead of fib() it would be the same.
also, if you've read through any programming book that deals with recursion
and not seen "fib", wow!
-- vish
On 4 September 2012 13:03, Mr I <cub4ucme at gmail.com> wrote:
> Really not one to make comment but this one pulled on my goatee
>
> On Tue, Aug 28, 2012 at 9:50 PM, Simon Wistow <simon at thegestalt.org>
> wrote:
>
> > On Tue, Aug 28, 2012 at 08:41:14PM +0200, Joel Bernstein said:
> > > It's a red flag of lack of clue if a prospective employer tries to use
> > > this to weed out candidates.
> >
> > I've literally had people who were "Senior" programmers (whatever that
> > means) who, when given the instructions "Given that fib(n) is equal to
> > fib(n-1) + fib(n-2) write a fib function in any language" didn't even
> > get to the
> >
> > sub fib {
> > my $n = shift;
> > return fib($n-1)+fib($n-2);
> > }
> >
> > let alone dealing with base cases or turning it into an iterative method
> > or memoizing or ...
> >
> >
> IMHO this is a typical example of an awful question!
>
> It requires additional knowledge of the problem domain NOT asked by the
> interviewer.Your assumption is that the candidiate knows:
>
> a) the fibonacci sequence
> b) mathematically how to calculate (included recurrence)
>
> It's such a flawed question.
>
> You're not testing the candidates knowledge of maths you're testing their
> knowledge of programming.
> The question does not allow you to assess whether the candidate is freezing
> due to their lack of knowledge in mathematics or in programming.
>
> It's equivalent to asking you to write a function ved(n, m) that implements
> the 16 sutras* and uses them to return the result. A task that maybe easily
> done by many an Indian programmer yet many in this group would struggle
> with.
>
>
> A "good" question should reference a closed problem domain with a clearly
> defined task (e.g. create a maze in a 6 by 6 grid, sort a pack of single
> faced cards, etc). That way you can assess the candidates reasoning,
> approach and coding (hopefully).
>
>
> My $0.02 cents
>
> Udo
>
> * vedic mathematics
>
More information about the london.pm
mailing list