I'm not sure how to answer this, because I find it difficult to imagine describing someone who got 3, 5, 6 or 7 wrong as a "fairly decent" perl programmer. 2 and 4 are more difficult, particularly since the candidate needs to guess how much they should say - I'm sure you could write for an hour on either one without exhausting the subject.
But they all seem reasonable questions; the only one I think is a bit unreasonable is #1, because it is code you wouldn't normally ever expect to write except in error. Perhaps more reasonable would be to say something like: 1. This code prints "5". Why is the "+" sign necessary?
print +(2 * 3) - 1;
Because of their open-ended nature, I'd also be inclined to put 2 and 4 last, and perhaps keep just one of them: they feel more like "extra credit" questions.
Hugo
-
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.
|