My current Perl Ironman Challenge status is: My Ironman Badge

Wednesday, July 8, 2009

Programming tests with Perl

I figured since my last post was so provocative, I've decided to write about something completely uninteresting and uncontroversial. Who here has had to take a programming test as a step in the interview processes? I know I have a few times.

Java tests. C# tests. Etc. Usually they want you to write from scratch some solution to a very contrived problem. And that is fine. They want to see a sample of your work and how to approach your problems. Sure as hell beats standing in front of a group of critical people with a dry erase marker in your hand and a massive expanse of whiteboard behind you.

Typically when taking a test for another language, writing stuff from scratch is mostly the norm. Oh sure there are open source libs out there for various languages, but when it comes to Perl and the massive CPAN, those other libs are dwarfed by comparison. So when I come across a Perl test that wants you to write something from scratch when a myriad of distributions on CPAN solve that exact problem, I get a little worried. Does this corp environment discourage use of CPAN to avoid reinventing the wheel? Does NIH permeate their corporate culture to the point of detriment?

In the past, I simply fired up cpan, changed a few config options and made sure things were installed into a local directory. The proctors of the test were a little intrigued, but mostly they were against the idea. They wanted to see me waste my time writing the wheel again. Ultimately, in that particular instance, I didn't get the job. And probably a good thing, too.

Of all the tests I've taken in the past though, they given me a machine, most of the tools I would expected to use, and a fast enough internet connection to use for searching for hints. And this makes sense. You wouldn't ask a graphic designer to create a design without some graphics program like Illustrator or Photoshop or tell an architech to draw up some blue prints without advanced CAD software. So why would a software programmer be any different?

Recently, I took another Perl test from a recently well known municipal auction provider, but this time I wasn't supposed to use a proper editor with syntax highlighting, I wasn't supposed to attempt to compile my answers, nor was I supposed to use any internet based resources. My face wrinkled up into the weirdest frown. They wanted to duplicate a "written" test environment. How does that have any bearing on the job they are potentially asking me to do? Not that they could enforce that since it was just a dumb form on a page without any javascript (I certainly didn't turn it on to see).

So I used the tools at my disposal to solve their contrived problems to the best of my ability using the tools that I use to develop software: vim, perl5.10.0, etc. I also made sure that my solutions were wrapped up into proper classes (via MooseX::Declare), reusable, and took advantage of modern Perl idioms. Save for some hairy multiple sorting that was giving me an issue, all of my answers compiled the first time without syntax problems and all ran as designated in the problem without issue. I tried to be as thorough as possible without going overboard. MooseX::Method::Signatures via MooseX::Declare saved me a lot of time from validating inputs, etc by hand, so that was a big win. If I had had to do that myself, I wouldn't have finished the test.

For some reason, I didn't get this job either. I asked for a little more feedback but I don't believe it will be forthcoming, which is their prerogative. It would be nice to know how I did on their test.

But considering my short chat with one of their developers at YAPC a couple of weeks ago revolved around "Why would you use POE when we could just spin up another persistent mod_perl instance?" perhaps it is good that place decided to look elsewhere.

So just for the record, if any of you future employers out there want to give me a test, please remember that I am going to use all of the tools at my disposal and give you an honest effort at solving your problems. If you tie my hands behind my back and then are disappointed with the result of my painting a bikeshed with my feet, that's your problem and not mine.

No comments:

Post a Comment

Post a Comment