home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16539 < prev    next >
Encoding:
Text File  |  1992-11-18  |  2.5 KB  |  51 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!purdue!mentor.cc.purdue.edu!noose.ecn.purdue.edu!en.ecn.purdue.edu!krauskop
  3. From: krauskop@en.ecn.purdue.edu (Curtis D Krauskopf)
  4. Subject: Re: New Employee Test
  5. Message-ID: <1992Nov19.002724.13837@en.ecn.purdue.edu>
  6. Summary: My employee test in C
  7. Organization: Purdue University Engineering Computer Network
  8. References: <assist.721943530@orion.oac.uci.edu>
  9. Date: Thu, 19 Nov 92 00:27:24 GMT
  10. Lines: 39
  11.  
  12. I run a database programming company.  My favorite interview questions 
  13. ask the candidate how a bubble sort works.  Later in the interview,
  14. I ask the candidate to "write a C function to bubble sort an array of
  15. integers on paper, and tell me how long you think it will take".  It
  16. is the candidate's responsibility to ask about the parameters of the
  17. function, the return value, whether the sort should be ascending or
  18. desending, how many integers are in a typical array.... etc.  Any 
  19. reasonable question, regardless of its nature, is a bonus point.
  20. Suggestions that a quicksort or other algorithm be used (especially
  21. since quicksort is a standard library function) get many bonus points.
  22. If the candidate asks, they can have full access to the company library
  23. of C books.  (I don't believe in closed-book tests, especially on-the-job).
  24.  
  25. When the candidate returns with the answer, I have them desk-check a
  26. bubble sort function that has some bugs in it.  I tell them that the
  27. function compiles, but it doesn't work right.   I also have them 
  28. rewrite the function so that it runs more quickly (the function uses
  29. a brute-force bubble sort with an off-by-one error in the two loops
  30. and it calls a function called swap() to swap the two integers).
  31.  
  32. Now granted, it isn't every day that a programmer writes a bubble sort,
  33. but I've been amazed at how much this sequence of questions has told me
  34. about a programmer's ability, their systems analysis experience, their
  35. ability to communicate technical issues, and their awareness of details
  36. behind how a languges operates.  
  37.  
  38. I do not dock the candidate too many points for not knowing or remembering
  39. how a bubble sort works.  Once I explain it to them, though, I would expect
  40. them to be able to write the function.  I also take into consideration
  41. whether the candidate has any 'real-life' work experience when evaluating
  42. the questions (or lack thereof) when the candidate asks about the function.
  43.  
  44. Although my example isn't in C++, I think you could arrange it to be a 
  45. C++ program, maybe even having the candidate create a class to bubble 
  46. sort integers.
  47.  
  48. Curtis
  49.  
  50.  
  51.