Ugly Stool Rotating Header Image

January 23rd, 2009:


I really enjoy reading about the various interview questions used by people in the industry when interviewing new candidates.  Go check out the big boys, and you will see what I mean.  There are literally web pages, and blogs dedicated to interview questions.  Heck, there are legions of pages dedicated to Google’s interview questions.  What I want to know is where I can find those people.  I am never even approached asking those questions in an interview.  I must be, or have been working for the wrong company.  Perhaps Google can attract that talent, but my employer cannot.

The programming question that I ask is usually very easy to answer.  At least, I think it is.  There are multiple solutions to the problem, and I always preface the questions by saying, “You can answer it any language you want.”

You are given a string of floating point numbers that are delimited by a pipe character.  How would you parse the string into an array of floats.  You do not have to worry about memory management, and you can solve the problem in any language you want to.

I always write something on the board to further convey the problem.  I always write it in C, but the interviewee can solve it in their language of choice.

   1: char *s = "10.5|11.1|9.12";

Any of these solutions would solve the problem easily, but only two people have thus far done so.

  1. sscanf
  2. std::cin
  3. strtof, strtod, strtold, atof
  4. strtok combined with something from 3
  5. split

If I cannot get a candidate to make it past these questions what is the point in asking them to reverse a string, or delete a link list.

Page optimized by WP Minify WordPress Plugin