Brainbench perl test?
sthoenna at gmail.com
Wed Sep 5 19:37:32 BST 2012
On Tue, Sep 4, 2012 at 12:31 PM, Paul Makepeace <paulm at paulm.com> wrote:
> The spec for fib() was given; the spec for ved() was not. That is the
No, neither were spec'd enough to code from. (As is true for every
spec I've ever seen.)
Either should lead to questions before a single character of coding.
And the questions I'd ideally like to see from the fib problem aren't
just "what is the value of the element at position 0 and 1", (which
assumes the sequence starts at 0, something not in the problem statement)
but about what the expected range of input is, what to do with invalid
input, even the relative importance of startup time cost vs per call
cost (a lookup table may be a better choice than memoization) and the
memory resources available.
And if you are looking for how and what questions someone asks and how
the resulting conversation goes, fib() provides a trap where someone
familiar with the sequence may assume instead of asking, which IMO is
a reasonable response given the name of the function. So ved() wins
in my book.
More information about the london.pm