My favorite question from that pool was "How would you parse a CSV input?" , the answer of course being.. "Don't!, use Text::CSV and get on with your life."

I've had the same general philosophy overall, but strangely enough that's rarely the answer employers are looking for. So I've come up with a multipart response:

  1. Ask for more details about the CSV being input. Ask the clever things like what types of values could be in the string, what's the encoding, are paired quotes acceptable, is the first row a header, and anything else I think of.
  2. Tell them my first choice would be to use Text::CSV - or if my memory is sharp that day, I'd mention a few of the variants. I'd also try to show them an example of usage appropriate to the information I gathered in part one.
  3. Then, in the inevitable case where they look at me with that "Yes yes, but what if a sniper takes a shot at you every time you load cpan?" look, I'd try to sort through the solution just with core components. It's tedious, and I'd prefer to not take a job where using CPAN was a capital offense. Then again, just looking at it as a problem-solving exercise makes the interview kind of fun. And really, after enough interviews, I'm looking for any way to make them more pleasant experiences.

  4. In reply to Re^2: Some reflections on the Brainbench Perl Test by webfiend
    in thread Some reflections on the Brainbench Perl Test by metaperl

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  5. Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  6. Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  7. Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  8. Please read these before you post! —
  9. Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  10. You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  11. Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  12. See Writeup Formatting Tips and other pages linked from there for more info.