Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Well, question 1 will help you weed out the C programmers who still think of expressions as statements. I don't think I'd hire anyone who says it prints "9". Question 2 is worthless; they're all going to regurgitate the stock answer whether they believe a word of it or not. And they're going to waste three minutes writing that answer. Question 3 is preposterously easy, but I suppose it's okay to have one of those. 4 is the best question you asked. There are enough differences that if they can't list at least three you know they don't understand scoping. (Though personally I'd turn it around and talk about the important similarity between them (that they both define scope statically at compile time).) 5 and 6 are just syntax (though 5 is pretty obscure syntax; if you use it in an actual program, you're very likely doing something in a highly non-Perlish way). OTOH, 5 and 6 take virtually no time to answer, so they don't lengthen your test that much. 7 could maybe be reworded and/or restructured, but it's fundamentally a pretty good question.

If I were (re)writing the thing, I'd pull question 2 and replace it with something with no stock "right answer" so you can get a better feel for their actual views. Maybe something about what their favoured debugging techniques are or what kinds of jobs they find Perl best suited for. I'd add one more question about something moderately advanced, like a question about map or closures. And I'd probably reword the text of 7 a bit, though the code part is probably fine as it stands.

But I've seen fairly decent Perl people getting 3,4,5,6 and 7 wrong.

You define "fairly decent" differently than I. This is an *easy* test. *None* of the questions are hard. 1 could be considered tricky, and 5 could be considered unnecessary (not something you often need to do, so maybe not something they've looked at recently), and 4 is something a lot of people never bother to understand (though they should). So missing one of those three, or *maybe* two of them, is understandable. And you figure anyone can pull a braindead moment on one question for no reason. But that would still be at *least* 4/7 correct. 2/7 on this test is positively abysmal.

Oh, and you ought to give full credit to anyone who answers 5 by saying "it sets off a red flag that tells me this section needs to be rewritten". I think maybe half of all uses of $#array occur in a construct like for ($i=0;$i<=$#array;$i++) and are usually implementing something there's a Perl builtin for (such as a sort).

If you want a question to quickly identify people who have used Perl for a decent assortment of tasks, ask them to list some modules that they have used that can be found on CPAN. Don't tell them how many to list, but give them room to list a couple of dozen if they can.

{my$c;$ x=sub{++$c}}map{$ \.=$_->()}map{my$a=$_->[1]; sub{$a++ }}sort{_($a->[0 ])<=>_( $b->[0])}map{my@x=(& $x( ),$ _) ;\ @x} split //, "rPcr t lhuJnhea o";print;sub _{ord(shift)*($=-++$^H)%(42-ord("\r"))};

In reply to Re: A Perl aptitude test by jonadab
in thread A Perl aptitude test by Jonathan

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (8)
    As of 2014-08-30 15:40 GMT
    Find Nodes?
      Voting Booth?

      The best computer themed movie is:

      Results (293 votes), past polls