Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://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 eretk.as 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

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-29 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found