Saturday, June 6, 2009

Testing Programming Interview Questions...

I was cruising around the internets today and stumbled upon one of those sites that posts programming interview questions. You know the ones: archetypal algorithmic queries requesting the shortest way to move manhole covers from Mt. Fiji while weighing eight balls of 3 different colors (choose only two). Those kind of rudimentary questions.

I suppose the allure is that if one were able to successfully answer all the questions, they'd be a shoe in for the illustrious programming gig. Or perhaps to validate themselves; either they haven't been discovered (yet!) or are simply too brilliant to be burdened with the trivial job search (gimme a raise!). Only narcissists - insecure in their feeble abilities - answer these out-dated questions to puff up their sense of self-importance with a strapped-down, vein-tapped quick-fix of techno-trivia devoid of context.

So by the time I got to question number 6, I was feeling pretty good about myself. It read as follows:

You’ve got someone working for you for seven days and a gold bar to pay them. The gold bar is segmented into seven connected pieces. You must give them a piece of gold at the end of every day. If you are only allowed to make two breaks in the gold bar, how do you pay your worker?

I pondered for a bit, acquiesced to my plebeian logic, and moved ahead to the answer. However, when I read the answer I realized that it required that the worker be willing to trade in yesterday's pay for today's pay. Ummm???!!!!(Note I cannot spell the word I want to type here, so I'll simply link to a wav sound of it in use). I would never have arrived at that conclusion. There appeared to be a great many assumptions about what actions could/could not be taken.

And that is why I'm writing this. I'm not so much fascinated by the answers as I am the meta-questions. What questions would you ask before you would feel satisfied?

Some of mine include:

-Can anyone else cut the gold instead of/in addition to me?
--If Yes: Are they subject to the same restriction as me?
---Do we both get 2 cuts each?
---Must I pay extra for their services?
---Can we renegotiate the terms if the worker is the cutter?
-With what are we cutting the gold?
--What if the cut cannot be made in a 24-hour period?

What questions would you ask?