Effective Perl by Joseph N. Hall

Observations and Tips from the author of Effective Perl Programming

Thursday, October 11, 2007

Your Phone Screen Homework Question

Before or after the phone screen, depending on how things work out, you may be asked to complete a short programming exercise. It won't be something with a lengthy answer but it will require you to demonstrate an understanding of a few key Perl skills. Here is the one that I have used recently. It is a kind of "beginning intermediate" question about a type of problem that comes up reasonably often in serious Perl programming and that has a distinctive Perl solution. Ordinarily you would be allowed access to (and encouraged to use) the Internet and/or other references if necessary.

The problem:

Create a hash that represents a set of items, and another hash that represents another set of items.

Compute a hash that represents the union of both sets.

Compute a hash that represents the intersection of both sets.

Print out the contents of the union and intersection sets sorted in alphabetic order.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home