There's a lot of good advice on how to interview here at the Monestary. Just a quick search turns up:

  1. Assessing Perl skill level in job interviews
  2. Interview questions
  3. Perl Interviews

I have, instead, bad advice, more in the vein of How's your Perl? and How's your Perl? (II) The last time I used these questions, I asked a coworker who sat in on the interview about them. He responded by saying that if someone gets them right, you know they know Perl really well. If someone gets them wrong, however, you can't tell whether they know Perl well or not. I agree, so I'm more or less retiring them here.

How are these two different?

$self->foo(); foo($self);

(Assume for this problem that $self is a blessed object of some kind.)

How are these two different?

($x) = foo(); $x = foo();

How are these two different?

for ( @x ) { foo( $_ ) } map { foo( $_ ) } @x;

What does this output?

sub baz { return 11 unless shift } print 'baz(5): ', baz(5), "\n"; print 'baz(0): ', baz(0), "\n";

What does this output?

my $FOO = 'foo'; sub bar { $_[0] = 'bar' } print $FOO, "\n"; print bar( $FOO ), "\n"; print $FOO, "\n";

What does this output?

for my $s ( qw( a b c ) ) { $s =~ s/$/\n/ && print $s }

Yes, I really did ask these questions of a candidate. In my defense, I prefaced my questions by saying that I was not very concerned with whether he got the answers right or not. These questions were meant to be "conversation pieces."


In reply to Evil Interview Questions by kyle

Title:
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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.