testing c skills

Discussion in 'C Programming' started by junky_fellow@yahoo.co.in, Apr 17, 2006.

  1. Guest

    Hi guys,

    I want to have your opinion on how a candidate should be judged for
    his programming
    skills in C ? Should he be checked for his programming basics or should
    he be asked to
    write a program for some problem (like sorting or searching ) ?
    , Apr 17, 2006
    #1
    1. Advertising

  2. ed Guest

    On 16 Apr 2006 22:42:50 -0700
    "" <> wrote:

    > I want to have your opinion on how a candidate should be judged
    > for
    > his programming
    > skills in C ? Should he be checked for his programming basics or
    > should he be asked to
    > write a program for some problem (like sorting or searching ) ?


    The candidate should be judged on overall ability with other languages
    too, I think it shows a strong candidate when he can write in multiple
    languages, if this is for the purposes of employment you should consider
    if the candidate is aware when C should be used, and when there are
    other languages which might fit the purpose better.

    If for the purpose of employment you should bias your tests strongly
    against the line of jobs that you think the candidate will be
    performing, for example if they were to write you a custom email server
    you should probably test their ability with general email RFC's, things
    such as mime encoding and headers would be of vital importance (along
    with many other aspects of safe design).

    You might also (if interviewing a very large section of people) take a
    look at online tests by people like brainbench.com to see what their
    people think are important in the C language.

    Or just take a look at the FAQ for some examples of questions.

    --
    Regards, Ed :: http://www.s5h.net
    :%s/\t/ /g :: proud unix system person
    :%s/Open Source/Free Software/g
    ed, Apr 17, 2006
    #2
    1. Advertising

  3. said:

    > Hi guys,
    >
    > I want to have your opinion on how a candidate should be judged for
    > his programming
    > skills in C ?


    Here's one possible strategy:

    Start by getting the candidates to write a correct, robust "hello, world" C
    program. Most people simply can't do this in a correct and robust manner.
    In fact, you can probably eliminate a good (or bad!) 75% of candidates at
    this stage.

    Once you've done that, ask the remainder to write a program that adds two
    arbitrary integers (i.e. integers of any length) supplied as argv[1] and
    argv[2], again in a correct and robust manner. For example, the command
    line might be:

    ../add 739346584673839376487584638389 582473839893783736446474874162

    Eliminate any candidates whose programs supply incorrect results.

    (For the above example, 1321820424567623112934059512551 is the expected
    result.)

    Then eliminate any candidates whose programs don't handle incorrect input
    (at least one argument is either not present or not an integer).

    Then look through the programs and decide which candidate's code is the most
    readable and robust.

    --
    Richard Heathfield
    "Usenet is a strange place" - dmr 29/7/1999
    http://www.cpax.org.uk
    email: rjh at above domain (but drop the www, obviously)
    Richard Heathfield, Apr 17, 2006
    #3
  4. Richard Heathfield <> writes:
    [...]
    > Once you've done that, ask the remainder to write a program that adds two
    > arbitrary integers (i.e. integers of any length) supplied as argv[1] and
    > argv[2], again in a correct and robust manner. For example, the command
    > line might be:
    >
    > ./add 739346584673839376487584638389 582473839893783736446474874162
    >
    > Eliminate any candidates whose programs supply incorrect results.

    [...]

    Extra points for candidates who ask for clarification on the
    requirements. For example, are leading "+" and "-" signs allowed?
    Does a leading "0x" or "0X" denote hexadecimal, or is it an error?
    Does a leading "0" denote octal or decimal? How should the program
    respond to invalid inputs?

    Finally, how portable does the program have to be? The simplest way
    to do this is probably to use system() to invoke "bc". Next best is
    to use GMP (download and install it if it's not already on the
    system).

    If the solution has to be self-contained portable C, I probably
    wouldn't ask someone to solve this during an interview; it's likely to
    take too much time that could have been spent talking to the
    candidate.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Apr 17, 2006
    #4
  5. Flash Gordon Guest

    Keith Thompson wrote:
    > Richard Heathfield <> writes:
    > [...]
    >> Once you've done that, ask the remainder to write a program that adds two
    >> arbitrary integers (i.e. integers of any length) supplied as argv[1] and
    >> argv[2], again in a correct and robust manner. For example, the command
    >> line might be:
    >>
    >> ./add 739346584673839376487584638389 582473839893783736446474874162
    >>
    >> Eliminate any candidates whose programs supply incorrect results.

    > [...]
    >
    > Extra points for candidates who ask for clarification on the
    > requirements. For example, are leading "+" and "-" signs allowed?
    > Does a leading "0x" or "0X" denote hexadecimal, or is it an error?
    > Does a leading "0" denote octal or decimal? How should the program
    > respond to invalid inputs?
    >
    > Finally, how portable does the program have to be? The simplest way
    > to do this is probably to use system() to invoke "bc". Next best is
    > to use GMP (download and install it if it's not already on the
    > system).
    >
    > If the solution has to be self-contained portable C, I probably
    > wouldn't ask someone to solve this during an interview; it's likely to
    > take too much time that could have been spent talking to the
    > candidate.


    I don't think it is tremendously difficult or long. Strip any leading
    spaces, check the first character (possibly the second as well to detect
    0x), allocate space (remembering the result could be one character
    longer than the longest number) then work from the other end of the
    strings adding a digit at a time.

    Personally, if interviewing, I would be more likely to ask how to solve
    certain types of problem, what gotcha's to look out for and about things
    they have done in the past.
    --
    Flash Gordon, living in interesting times.
    Web site - http://home.flash-gordon.me.uk/
    comp.lang.c posting guidelines and intro:
    http://clc-wiki.net/wiki/Intro_to_clc
    Flash Gordon, Apr 17, 2006
    #5
  6. CBFalconer Guest

    Richard Heathfield wrote:
    > said:
    >>
    >> I want to have your opinion on how a candidate should be judged
    >> for his programming skills in C ?

    >
    > Here's one possible strategy:
    >
    > Start by getting the candidates to write a correct, robust "hello,
    > world" C program. Most people simply can't do this in a correct
    > and robust manner. In fact, you can probably eliminate a good (or
    > bad!) 75% of candidates at this stage.
    >
    > Once you've done that, ask the remainder to write a program that
    > adds two arbitrary integers (i.e. integers of any length) supplied
    > as argv[1] and argv[2], again in a correct and robust manner. For
    > example, the command line might be:
    >
    > ./add 739346584673839376487584638389 582473839893783736446474874162
    >
    > Eliminate any candidates whose programs supply incorrect results.
    >
    > (For the above example, 1321820424567623112934059512551 is the
    > expected result.)
    >
    > Then eliminate any candidates whose programs don't handle incorrect
    > input (at least one argument is either not present or not an integer).
    >
    > Then look through the programs and decide which candidate's code is
    > the most readable and robust.


    Then make it harder and require that they do the job without
    additional storage apart from a few char variables, and possible
    recursion effects. :)

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
    More details at: <http://cfaj.freeshell.org/google/>
    Also see <http://www.safalra.com/special/googlegroupsreply/>
    CBFalconer, Apr 17, 2006
    #6
  7. <> wrote in message
    news:...
    > Hi guys,
    >
    > I want to have your opinion on how a candidate should be judged for
    > his programming
    > skills in C ? Should he be checked for his programming basics or should
    > he be asked to
    > write a program for some problem (like sorting or searching ) ?
    >


    The problem with all testing methodologies is that people have weaknesses in
    different areas. When you develop a test, you "discriminate," intentionally
    or not, against certain skills and types of intellect. If you test for
    intricate knowledge of simple language details, as Heathfield and Thompson
    suggested, you may end up with a programmer whose code is correct, but who
    struggles to solve bigger problems. If you test for problem solving
    ability, you may end up with a programmer who can solve problems elegantly,
    but who struggles to implement the code correctly. The programmer may be
    strong in one or more of string processing, or databases, or numerical
    computation, or DSP algorithms, microcontrollers, but at the same time be
    weak in the other areas.

    You need to define what your business needs are for that person. What areas
    of coding is your business involved in? If you're in finance, do you want
    someone who is strong in string processing or databases? You'd probably
    want someone strong with numerical computations...


    Rod Pemberton
    Rod Pemberton, Apr 17, 2006
    #7
  8. Ian Collins Guest

    wrote:
    > Hi guys,
    >
    > I want to have your opinion on how a candidate should be judged for
    > his programming
    > skills in C ? Should he be checked for his programming basics or should
    > he be asked to
    > write a program for some problem (like sorting or searching ) ?
    >

    I tend to probe the candidate on a recent project to try to get a feel
    for their ability to describe the problem and their solution.

    I used to pose programming questions, but after suffering some realy
    stupid ones myself I prefer to trust my judgement based on past work.
    Once I have a feel for the candidate's perceived strengths and
    weaknesses, I'd have one of my team pair with them for and hour to see
    how they work on real world problems and more importantly, how well they
    fit in with the team.

    --
    Ian Collins.
    Ian Collins, Apr 17, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Girish
    Replies:
    10
    Views:
    810
    Steven Cheng[MSFT]
    Mar 6, 2004
  2. =?Utf-8?B?UmFlZCBTYXdhbGhh?=

    Imporving programming skills

    =?Utf-8?B?UmFlZCBTYXdhbGhh?=, Jun 29, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    507
  3. PFN
    Replies:
    2
    Views:
    361
    Mickey Segal
    Apr 8, 2004
  4. John
    Replies:
    2
    Views:
    1,347
    llewelly
    Sep 4, 2003
  5. Shane Beasley
    Replies:
    2
    Views:
    375
    Govindan
    Sep 9, 2003
Loading...

Share This Page