Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

gav (2710)

  (email not shown publicly)
AOL IM: flufflegavin (Add Buddy, Send Message)

Hacker in NYC.

Journal of gav (2710)

Thursday April 08, 2004
04:39 PM

Interview questions

[ #18242 ]

We have a set of questions for new hires. I'm trying to think up a new one that would both be of a enough difficulty, see if they think to use any modules from CPAN, lead to plenty of talking points during an interview, and be relevant to the sort of things we do here.

We need a utility called fixlinks. Its job is to take an html file, convert all the links inside it to absolute ones, then save the output. It should take three command line arguments, an input filename, an output filename, and the link base.

Implement this program (in Perl).

Consider the edge cases in both determining a link and making a url absolute; create a program to test these cases.

How well does it handle html that is not technically valid, yet works in a browser?

Does this seem sensible? What would you write?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • WT column 22 []. Mostly done, anyway. Theory is there.
    • Randal L. Schwartz
    • Stonehenge
    • Is there anything Perlish that you haven't written about? I would give bonus marks to a interviewee that provided a url to one of your columns.

      I do have a few things to nit pick about the code, but I'll save them for a day or so to see if anyone else posts an answer.
  • I sure hope so, otherwise you will be sitting around for a pretty long time during the interviewee(sp??) defines, designs, programs, and tests the perl code.

    Given as a pre-interview task it allows for a good view into the coders world. You could not only see someone solving a problem but also question his/her thoughts behind certain pieces of code.

    • Sorry for not being clear, the questions are given before the interview. You are right, the main goal is to be able to question the applicant's thinking. It gives us something more interesting to talk about and hopefully draws the applicant out into a more prolonged conversation. How you think is more important than how well you can recite parts of "Programming Perl". For this reason I prefer questions like "what do you like least about Perl?" over "what's returned by stat?".
  • But, since I usually interview a company as they are interviewing me, I'd ask you for use cases to the program to see if the company writes things on napkins and say "MAKE THIS WORK" or actually thinks things out.

    I was once being interviewed and one of the people had a real-life problem he wanted worked out. We brainstormed on a whiteboard together. This was excellent to do. I, as the interviewee, got to see what a brainstorming session with a possible co-worker would be like, and he got to see what it wou
  • Why don't you just open the site up in your HTML editor and click on the little widget that says to use absolute URL's?