Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Time for another "interview question" post. We're in the process of hiring some programmers. Naturally, we go through the typical interview process and as them some questions to assess the Perl knowledge, but we're also interested in their programming knowledge. I've been somewhat disappointed with some of their answers, so I'm curious as to how Monks would respond to these questions and how you would change them. These questions are deliberately language agnostic as we're focusing on aptitude here.

1. The following code snippet works, but has been identified as a significant performance problem in a production program.

a. Why is it a problem?
b. What would you do to fix it?

foreach a_item in a_array foreach b_item in b_array if a_item equals b_item put a_item in c_array end if end for end for

The order of elements is not important.

2. Write a function (language of your choice) to do an in-place reversal of array elements. For example:

array = ( 'foo', 'bar', 'baz', 'cheeze whiz' )


array = ( 'cheeze whiz', 'baz', 'bar', 'foo' )

If the "language of your choice" has a built-in method for doing array reversal, disregard it.

3. Briefly sketch out how you would implement a program/system to handle multiple requests (perhaps from Web forms), query a database based upon the request and display the results. There are multiple request sources and multiple display formats.

Code is not required for this one. We're looking for how you would organize this.

I'd give a list of what we're looking for on these, but that would be giving you hints. Many of the programmers that we have interviewed have plenty of experience, but fail miserably when faced with the above questions, though they seem fair to me.


Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

In reply to (OT) Interview questions -- your response? by Ovid

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • 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;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (8)
    As of 2019-06-18 23:05 GMT
    Find Nodes?
      Voting Booth?
      Is there a future for codeless software?

      Results (83 votes). Check out past polls.

      • (Sep 10, 2018 at 22:53 UTC) Welcome new users!