testing c skills

J

junky_fellow

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 ) ?
 
E

ed

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.
 
R

Richard Heathfield

(e-mail address removed) 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.
 
K

Keith Thompson

Richard Heathfield said:
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.
 
F

Flash Gordon

Keith said:
Richard Heathfield said:
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.
 
C

CBFalconer

Richard said:
(e-mail address removed) 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/>
 
R

Rod Pemberton

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
 
I

Ian Collins

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top