My stabs as a new Perl programmer.
- Either a tab or a 9 gets displayed. Alternatively, maybe a 6 (or a an ASCII 6, whatever that is) followed by an ASCII 3? This seems unlikely. Or get a syntax error, I suppose, but something tells me that's not right either. I'm going to guess a tab gets displayed.
- Probably many reasons, but catching typos is good.
- Grr. I always have to look these things up. Guessing something in the s/\s+$// or s/\s*$// area would do it.
- Not sure. Guessing one has the scope of both the package and the main script whereas the other is scoped just to the package?
- Umm...sets $var to the value in the ...uhmm...last element (?) from the @array? Or does it give us the element count? I think it's the value of the last item. Have to look it up.
- Dunno. Read from STDIN?
- $a (?)
So...given how poorly I did on this test, we move on to your request for suggestions.
Frankly, that depends on your goals. Sure, you're trying to assess peoples' skills. But interviews are also partially about assessing them as people. Do you want to make them feel disqualified and test their defensiveness? Or does this part of the interview come at the point where you want them to feel welcome and loosen up a bit? Or do you not play those kinds of games during an interview process?
From a technical test perspective, I don't know that you need to worry about changing it. Just based on how close they come, or if they're willing to indicate where they think they'd go looking first is probably enough to determine if you've got a problem-child or a problem-solver sitting in the hot seat. In my opinion, that's worth more than education when it comes to software development and maintenance. Especially at entry level positions.
Now to go look up the answers to see how badly I did.
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- 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
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||