Two years ago I wrote a short Perl test for perspective employees of the company I work for...
1. What does following statement do?
print (2 * 3) + 3;
2. Why is the use strict; statement useful?
3. Write a regular expression that removes trailing white space fro
+m a string
4. What is the difference between a lexical variable and a package
5. What does the following statement do?
$var = $#array;
6. What does the <=> operator do?
7. Given the following data structure.
How would you access the value c in the scalar $a?
$a = [
The test is part of a larger exam that also covers 'C', Unix, Java and SQL. Candidates are asked to rate their knowledge of the technoglogies from none, fair, good or expert. Therefore, I want the Perl section just to give me an indication that they are telling the truth. If we wanted a Perl specialist I'd do a technical interview with them later.
The problem is I don't think the test I wrote does this. While some questions seem reasonable to me, I get complaints about others. OK Question 1 is a bit of a trick question - I think I originally saw it suggested on a Perl site and thought it fair enough. But I've seen fairly decent Perl people getting 3,4,5,6 and 7 wrong.
Does any one have any better suggestions?
Needless to say that I consider most people who read this site as more than acceptable for our needs!
edited: Fri May 2 16:19:40 2003
by jeffa - title change (was: A Perl test)
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:
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.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||