Saturday, August 20, 2005

Deja Vu

So I'm sitting here, reading Higher Order Perl (which is one of those books that takes a great deal of thought to get through, which is why I'm still only on chapter 5 despite the fact that I've been reading it off and on since it first came out months ago), and I can't help but be incredibly amused by section 5.4.3, which shows you how to convert a recursive function into a nonrecursive function by inlining the stack management that the programming language does for you in the recursive version.

You see, the example MJD used is iterating over a tree, and that means the code he wrote is implementing the solution to a question I was asked when I interviewed at Trilogy back in college.

The reason I'm really amused by this is that I was actually asked this question twice when I interviewed at Trilogy, once on campus where I totally nailed it, and once at the actual on site interview, where I blanked in the worst possible way and couldn't manage to come up with a reasonable answer even after the engineer conducting the interview started feeding me some really explicit hints as to how to do it.

I'm reasonably certain that it's that question and my complete and total inability to answer it that kept me from getting a job offer from them, since as far as I can tell the rest of my interviews went really well.

Of course, a few months after that interview Trilogy had massive layoffs that decimated their engineering groups, and judging from the feelings about the place I got from the people I met there, I don't think I'd really want to work there anyway, so with that in mind I'll always have a spot in my heart for that particular programming problem ;-)