On Mon, 2005-03-07 at 01:51 -0500, James Freeman wrote:
So this leads me to this scenario and a question, your manager has asked
you to be part of the interview process for a new programmer position
that involves Perl and he wants you to make sure this person knows their
Perl.
I use a
On Mon, 2005-03-07 at 08:17 -0500, Greg London wrote:
3: What is printed when this script executes?
my %hash;
if($hash-{key1}-{key2})
{print Exists!;} else {print Doesnt exist}
print Dumper \%hash;
5: What is printed when this script executes?
package Dog;
sub Speak { print Dumper [EMAIL
Aaron Sherman said:
On Mon, 2005-03-07 at 08:17 -0500, Greg London wrote:
5: What is printed when this script executes?
package Dog;
sub Speak { print Dumper [EMAIL PROTECTED]; }
Dog-Speak('woof');
Bot answers are the same, nothing. I'd ask a followup question: What
if I used perl
From: Greg London
Sent: Monday, March 07, 2005 9:50 AM
And if the applicant seems to take joy in simply pointing out
the problem as a way of demonstrating how smart they are but
consistently needs prodding to answer the meat of the question,
I wouldn't let them work for me if you paid me.
On Mon, 2005-03-07 at 10:24, Palit, Nilanjan wrote:
(b) nothing to do with Perl - just assess the person's attitude vs. your
own team's dynamic. To me, this is much more important then the exact
technical skill.
Also nothing to do with the questions as posted. The answers were wrong,
and I
* Greg London email at greglondon.com [2005/03/07 10:43]:
Palit, Nilanjan said:
$ perl -e '$x=1; $y=$x+++1; print x=$x, y=$y\n'
Bummer. I just got a ding on your interview.
How do you parse $x+++1 ?
$ perl -MO=Deparse,p -e '$x=1; $y=$x+++1; print x=$x, y=$y\n'
$x = 1;
Palit, Nilanjan wrote:
- Basic questions on boolean expressions operator precedence
like, why does 'open(...) or die ...' work? (and similar questions
posed by Greg)
That seems perfectly reasonable to me - open or die is a hugely
common (and very readable) construct.
- A rather
Palit, Nilanjan said:
~~$ perl -e '$x=1; $y=$x+++1; print x=$x, y=$y\n'
Bummer. I just got a ding on your interview.
How do you parse $x+++1 ?
$y=$x+++1
is
$x+1
$y=$x
$x++
I believe.
If that's what you mean by parse. :-)
-John
___
] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, March 07, 2005 11:01 AM
To: [EMAIL PROTECTED]
Cc: Boston-pm@mail.pm.org
Subject: RE: [Boston.pm] Perl popularity and interview questions
Palit, Nilanjan said:
~~$ perl -e '$x=1; $y=$x+++1; print x=$x, y=$y\n'
Bummer. I just got a ding on your interview
I can't remember if this was somethign I saw on TV or
someone told me or what.
Guy has a moving company.
He interviews some people to be movers.
He has a rather large safe in his office
sitting on the floor.
He asks each applicant to explain how
they would move the safe.
He interviewed a bunch
Palit, Nilanjan said:
No. In Perl (or C), $x++ = use then increment, whereas ++$x =
increment then use. Thus the expression will use the existing value of
x (1) to compute the value of y then increment x itself.
Doh! I get it. Thanks for that one.
observation: I've never used ++$x in a
On Mon, Mar 07, 2005 at 11:23:22AM -0500, Aaron Sherman wrote:
On Mon, 2005-03-07 at 10:57, David wrote:
I'd posit that the correct answer is: rewrite it.
And adding a space between $x++ and +1 is nowhere near enough.
Why not?
$y = $x++ + 1;
is quite readable, and very
On Mon, 2005-03-07 at 11:22, Palit, Nilanjan wrote:
-Original Message-
From: Greg London [mailto:[EMAIL PROTECTED]
Sent: Monday, March 07, 2005 11:17 AM
As for the triple-plus operator ;)
I'd think perl would take x, do a ++ on it,
get 2, and then do the +1 on it to get
My apologies to Aaron and anyone else on the list
who read this as an attack on Aaron (and anyone
who was going to post Aaron's same corrections)
It really wasn't my intent.
But having taken a second look at it,
I can see how it could be read that way.
Especially given the recent heated debate
On Mon, 2005-03-07 at 11:36, Ronald J Kimball wrote:
$y = $x++ + 1;
is quite readable, and very clear in its intent if you know know what
postfix:++ and infix:+ do (and you'd better). You don't even have to
know precedence, as it is implied by the (now correct) use of
whitespace.
On Mon, 7 Mar 2005 08:22:04 -0800, Palit, Nilanjan
[EMAIL PROTECTED] wrote:
-Original Message-
From: Greg London [mailto:[EMAIL PROTECTED]
Sent: Monday, March 07, 2005 11:17 AM
As for the triple-plus operator ;)
I'd think perl would take x, do a ++ on it,
get 2, and then
From: John Macdonald [mailto:[EMAIL PROTECTED]
Sent: Monday, March 07, 2005 12:50 PM
Precedence has nothing to do with it. The issue is how the
tokenizer breaks the input sequence '+++' into operator tokens.
Absolutely. The trickier version of the same question is when both sides
of the
On Mon, 07 Mar 2005 08:36:56 -0500, Aaron Sherman [EMAIL PROTECTED] wrote:
On Mon, 2005-03-07 at 01:51 -0500, James Freeman wrote:
[...] If you know more trivia
than I do (I've yet to see that), then I would hire you on the spot.
Let's turn this into, Let's try to stump Aaron!
Here are a
Ben Tilly wrote:
I think that everyone who interviews regularly has favorite
questions to ask.
Trouble is, I can't remember what my favourite is from one day to the
next ;-)
Other good technical interview questions include
creating a couple of sample tables and asking for the
SQL for a series of
On Mon, 2005-03-07 at 15:33 -0500, Uri Guttman wrote:
AS == Aaron Sherman [EMAIL PROTECTED] writes:
see what i do in File::Slurp. i wanted a single error handling sub but
also to have the croak in there report back from the original call (say
read_file).
Tried that. Problem is File::Copy is
AS == Aaron Sherman [EMAIL PROTECTED] writes:
AS On Mon, 2005-03-07 at 15:33 -0500, Uri Guttman wrote:
AS == Aaron Sherman [EMAIL PROTECTED] writes:
see what i do in File::Slurp. i wanted a single error handling sub but
also to have the croak in there report back from the original
On Tue, 2005-03-08 at 00:04 -0500, Uri Guttman wrote:
AS == Aaron Sherman [EMAIL PROTECTED] writes:
AS On Mon, 2005-03-07 at 15:33 -0500, Uri Guttman wrote:
AS == Aaron Sherman [EMAIL PROTECTED] writes:
see what i do in File::Slurp. i wanted a single error handling sub but
AS == Aaron Sherman [EMAIL PROTECTED] writes:
see what i do in File::Slurp. i wanted a single error handling sub but
also to have the croak in there report back from the original call (say
read_file).
AS Tried that. Problem is File::Copy is the kind of thing that's going to
23 matches
Mail list logo