C++ Aptitude Test?

213 views
Skip to first unread message

Jonathan Calvert

unread,
Feb 29, 2000, 3:00:00 AM2/29/00
to
I have about 5 years experience with C++ development and about 7 years of
general OOP experience. Recently (actually for a little over a year) I have
been leading Visual Basic projects.

In the next week or so I will need to take a C++ Aptitude test. If the test
is mostly syntax then I feel I will do very poorly. I do not have any
experience with the latest ANSI/ISO C++ Standard.

I am looking for some sample tests that I can use to judge my current C++
knowledge. I do not feel I will have any problems with actual OO, OOA/D,
concepts, etc., but I feel that the syntax questions will kill me. I
normally relay on reference manuals and on line help, but I understand the
need to have aptitude test.

At any rate, could someone point me in the direction of same syntax tests?
I have searched, but have thus far come up empty. I did find the recent
discussion about a "Reliable C++ Test", but I did not read through every
message to see if an actual syntax test was mentioned.

Any help would be greatly appreciated.
--
Please remove the SPAM blocker (NO-SPAM-PLEASE) to reply to my email
account.
Visit Calverts' Stuff: http://calvertj.home.mindspring.com/index.html

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]
[ about comp.lang.c++.moderated. First time posters: do this! ]


Ken Bloom

unread,
Mar 4, 2000, 3:00:00 AM3/4/00
to
It occurred to me that the AP test in Computer Science might be a logical
similarity, and there are many preparation books with practice tests
available for that. Please report back on your experience so we can gauge
the AP test's similarities to corporate tests.

Jonathan Calvert <jonathanNO-SPAM...@mindspring.com> wrote in
message news:89fa8h$irp$1...@nntp5.atl.mindspring.net...


> I have about 5 years experience with C++ development and about 7 years of
> general OOP experience. Recently (actually for a little over a year) I
have
> been leading Visual Basic projects.
>
> In the next week or so I will need to take a C++ Aptitude test. If the
test
> is mostly syntax then I feel I will do very poorly. I do not have any
> experience with the latest ANSI/ISO C++ Standard.
>
> I am looking for some sample tests that I can use to judge my current C++
> knowledge. I do not feel I will have any problems with actual OO, OOA/D,
> concepts, etc., but I feel that the syntax questions will kill me. I
> normally relay on reference manuals and on line help, but I understand the
> need to have aptitude test.
>
> At any rate, could someone point me in the direction of same syntax tests?
> I have searched, but have thus far come up empty. I did find the recent
> discussion about a "Reliable C++ Test", but I did not read through every
> message to see if an actual syntax test was mentioned.

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Mark

unread,
Mar 6, 2000, 3:00:00 AM3/6/00
to
brou...@yahoo.com wrote in message ...

>"Jonathan Calvert" <jonathanNO-SPAM...@mindspring.com> wrote:
>
>>I have about 5 years experience with C++ development and about 7 years of
>>general OOP experience. Recently (actually for a little over a year) I have
>>been leading Visual Basic projects.
>>
>>In the next week or so I will need to take a C++ Aptitude test. If the test
>>is mostly syntax then I feel I will do very poorly. I do not have any
>>experience with the latest ANSI/ISO C++ Standard.
>
>I'd be interested in hearing about your experience. I assume you've already
>taken the test?
>
>My first question would be why do you need to take one? Any employer that
>requires an "aptitude test" is one best avoided, in my not-so-humble
>opinion.

I couldn't agree more, especially when you are experienced.
You don't ask a carpenter when you hire him if he could bang
in a nail, just to prove that he can do it.

You don't ask a writer when you hire them to write 1000 words
on the spot, random topic, just to see if they can write.

I've recently been through this kind of thing and it's humiliating.
They don't give you a real computer to do your work, the setting
is entirely artificial, plus they lean over your shoulder putting you off.

In the end I got a job with a company who didn't ask me to do
those tests, and I'm very happy there. The interviewers in many
companies seemed to be more interested in proving how great
they were, and I just wasn't interested.

I walked out on one that asked me to code a tic/tac/toe puzzle
on paper, and it felt good :-) Their loss, not mine.

Cheers,
Mark.

Brett g Porter

unread,
Mar 7, 2000, 3:00:00 AM3/7/00
to

"Mark" <nos...@anywhere.org> wrote in message
news:38c42...@news2.cluster1.telinco.net...

> brou...@yahoo.com wrote in message ...
> >"Jonathan Calvert" <jonathanNO-SPAM...@mindspring.com> wrote:
> >
> >My first question would be why do you need to take one? Any employer
that
> >requires an "aptitude test" is one best avoided, in my not-so-humble
> >opinion.
>
> I couldn't agree more, especially when you are experienced.
> You don't ask a carpenter when you hire him if he could bang
> in a nail, just to prove that he can do it.
I couldn't agree less. We require a programming test before even doing a
phone interview. I review these tests occasionally, and it's not uncommon to
see people with impressive resumes a mile long submit code that looks like
they sneezed C++ tokens onto the screen. I've seen college students write
rock-solid code. Hm -- do I want to hire for 'experience' or ability? (scare
quotes intentional)

We sometimes accept sample code, but the last code sample that I reviewed
consisted of files that were barely edited from the MS DDK samples. No
thanks.

> I walked out on one that asked me to code a tic/tac/toe puzzle
> on paper, and it felt good :-) Their loss, not mine.

Maybe, maybe not. I don't know about where you work, but for us, hiring the
wrong person is _incredibly_ expensive.

David Dillard

unread,
Mar 7, 2000, 3:00:00 AM3/7/00
to
"Mark" <nos...@anywhere.org> wrote in message
news:38c42...@news2.cluster1.telinco.net...
> >My first question would be why do you need to take one? Any employer
that
> >requires an "aptitude test" is one best avoided, in my not-so-humble
> >opinion.
>
> I couldn't agree more, especially when you are experienced.

And like Brett, I couldn't agree less.

> You don't ask a carpenter when you hire him if he could bang
> in a nail, just to prove that he can do it.

True. But, are you saying that designing and writing good code is as simple
as banging a nail? I hope not.

> You don't ask a writer when you hire them to write 1000 words
> on the spot, random topic, just to see if they can write.

I've worked at a couple of places where candidates for tech writers were
asked to write short paragraphs on the spot.

> I've recently been through this kind of thing and it's humiliating.

It could be, but I wonder if your ego might have gotten in the way.

> They don't give you a real computer to do your work, the setting
> is entirely artificial, plus they lean over your shoulder putting you off.

Depending on the details of the test that may not have been an appropriate
setting.

> In the end I got a job with a company who didn't ask me to do
> those tests, and I'm very happy there. The interviewers in many
> companies seemed to be more interested in proving how great
> they were, and I just wasn't interested.
>

> I walked out on one that asked me to code a tic/tac/toe puzzle
> on paper, and it felt good :-) Their loss, not mine.

I did most of the technical evaluations at a company where I used to work.
I had one guy out of about seventy walk out on me, and afterwards I thought
it was *our* gain.

I've had people with years of 'experience' tell me that a double quoted
string didn't have a NULL character at the end. And did you know C has an
exponentiation operator? It was news to me. Shoot, just last Friday I had
a woman rate herself an 8, on a scale of 1 to 10, in C++ and she couldn't
tell me what a copy constructor is. (She rated herself a 7 in C - I'm
always skeptical when I hear someone rate themselves higher in C++ than in C
because C++ is so much more complicated.) I've seen people who just
graduated with bachelor degrees and no real world experience outperform
people with a masters degrees and experience.

You simply can't tell what people are capable of based on a piece of paper
and a casual conversation about past work. You have to delve into the
details to find out what people really know. When I interviewed for the job
I currently have a got a good grilling and I didn't have any problem with
it. Maybe its because I've seen so many people who've over stated their
abilities and qualifications that I don't mind demonstrating my own.


--- David

Rob Stewart

unread,
Mar 8, 2000, 3:00:00 AM3/8/00
to
David Dillard wrote:
>
> "Mark" <nos...@anywhere.org> wrote in message
> news:38c42...@news2.cluster1.telinco.net...
> > >My first question would be why do you need to take one? Any employer
> that
> > >requires an "aptitude test" is one best avoided, in my not-so-humble
> > >opinion.
> >
> > I couldn't agree more, especially when you are experienced.
>
> And like Brett, I couldn't agree less.

There are good and bad things about it, but I agree that testing
is necessary.

> > You don't ask a carpenter when you hire him if he could bang
> > in a nail, just to prove that he can do it.
>
> True. But, are you saying that designing and writing good code is as simple
> as banging a nail? I hope not.

OTOH, a carpenter has been through an apprenticeship program. He
can demonstrate compentency through documentation. We don't have
much in the C++ world that is remotely similar.

> > You don't ask a writer when you hire them to write 1000 words
> > on the spot, random topic, just to see if they can write.
>
> I've worked at a couple of places where candidates for tech writers were
> asked to write short paragraphs on the spot.

I'd like to see their editing skills, too.

> > I've recently been through this kind of thing and it's humiliating.
>
> It could be, but I wonder if your ego might have gotten in the way.

We've had some folks walk away saying, "I thought I knew C++ when
I came here; now I know how much more I have to learn." It's the
big fish in a little pond problem.

> > They don't give you a real computer to do your work, the setting
> > is entirely artificial, plus they lean over your shoulder putting you off.
>
> Depending on the details of the test that may not have been an appropriate
> setting.

If you rely totally on your tools to do your work, you will
necessarily work more slowly than someone that doesn't. That
doesn't mean you can't do the job. It just means you spend more
time looking up information and waiting for the compiler to tell
you that you used the wrong syntax.

> > In the end I got a job with a company who didn't ask me to do
> > those tests, and I'm very happy there. The interviewers in many
> > companies seemed to be more interested in proving how great
> > they were, and I just wasn't interested.

Perhaps the company that asked you to take a test was a poor
company to work for. Fortunately, the one you hired with was a
good company. it is coincidental that they didn't test you.

> > I walked out on one that asked me to code a tic/tac/toe puzzle
> > on paper, and it felt good :-) Their loss, not mine.
>
> I did most of the technical evaluations at a company where I used to work.
> I had one guy out of about seventy walk out on me, and afterwards I thought
> it was *our* gain.

My experience has been similar.

> I've had people with years of 'experience' tell me that a double quoted
> string didn't have a NULL character at the end. And did you know C has an
> exponentiation operator? It was news to me. Shoot, just last Friday I had
> a woman rate herself an 8, on a scale of 1 to 10, in C++ and she couldn't
> tell me what a copy constructor is. (She rated herself a 7 in C - I'm
> always skeptical when I hear someone rate themselves higher in C++ than in C
> because C++ is so much more complicated.) I've seen people who just
> graduated with bachelor degrees and no real world experience outperform
> people with a masters degrees and experience.

Now that's over-generalizing. The person with true experience
has more to base decisions on. They may rely more on their tools
than their recently fortified memory for syntax. It's hard to
judge the ultimate benefit of the people you hire no matter what
you do.

> You simply can't tell what people are capable of based on a piece of paper
> and a casual conversation about past work. You have to delve into the
> details to find out what people really know. When I interviewed for the job
> I currently have a got a good grilling and I didn't have any problem with
> it. Maybe its because I've seen so many people who've over stated their
> abilities and qualifications that I don't mind demonstrating my own.

Some folks have an easier time than others recalling syntactic
details. For proof, consider how many folks for whom English is
a second language have better grammar than those for whom English
is the first language. The former worked diligently to study the
new language. The latter have found that they can get away with
sloppiness and still communicate fairly well. Despite this, the
latter are almost always better at expressing an idea in English
than the former. This is because they are well versed in
idiomatic usage, slang, cultural references, etc. that help to
communicate the information. The former can't relate in those
same ways w/o significant immersion in the listener's culture.

The same happens with C++. A young college grad might know the
syntax better, but hasn't been seasoned by experience to know how
to apply it in many situations. The veteran may be better able
to apply C++ to a situation, but may spend a fair bit of time
fighting with the compiler to get something that compiles. The
veterans code will often be easier to understand because of the
application of common idioms and patterns, whereas the newbie's
code may be trite or convoluted.

Like I said, it's a complicated issue.

--
Robert Stewart | rob-at-giage-dot-com
Software Engineer | using std::disclaimer;
Giage, Ltd. | http://www.giage.com

Dean Roddey

unread,
Mar 8, 2000, 3:00:00 AM3/8/00
to
I think maybe the difference of opinion is the nature of the test. Some
places do this deal where you have to program something on the fly in front
of them. To me, this is a complete waste of time. No one programs like that,
and I don't think it says squat about a person's ability to produce high
quality code. It might say something about there level of humility, and
that's something interesting to know, but it would force out a lot of people
who would be great programmers because they just don't handle that kind of
situation well.

However, having to answer a list of tricky programming questions makes
perfect sense to me, and will weed out a lot of wannabes. Any serious
development house should require of their senior developers some time spent
interviewing new hires in this way I think.

--------------------------
Dean Roddey
The CIDLib Class Libraries
Charmed Quark Software
dro...@charmedquark.com
http://www.charmedquark.com

"Give me immortality, or give me death"

Jonathan Calvert

unread,
Mar 8, 2000, 3:00:00 AM3/8/00
to
I have not taken the test (the interview is later this week).

I do not have a problem with taking a test, but I do feel that it does not
actually judge my development skills. I may not be the king of syntax, but
I do know how to use a compiler, look up syntax in a reference manual, ask
for help, etc.

I can appreciate the need for technical test to screen out applicants. I
feel my strong points are analytical skills and problem solving. I am
actually interviewing for senior positions, so I do not feel that syntax
should be an issue.

For the record, some one emailed me a testing site: www.brainbench.com

I only scored a 2.84 on a scale of 1-5 (5 being the highest) on the C++
test. I am not sure how difficult folks in this group would rate the C++
test. There were several OO questions that I did not know because of lack
of experience. I am sure that I missed many questions due to "being rusty
in C++". I am very good with a debugger so I am sure that I could determine
the right answer or the syntax problem in a "real life setting".


--
Please remove the SPAM blocker (NO-SPAM-PLEASE) to reply to my email
account.
Visit Calverts' Stuff: http://calvertj.home.mindspring.com/index.html


<brou...@yahoo.com> wrote in message
news:an7CODwG1qHFWP...@4ax.com...


> "Jonathan Calvert" <jonathanNO-SPAM...@mindspring.com> wrote:
>
> >I have about 5 years experience with C++ development and about 7 years of
> >general OOP experience. Recently (actually for a little over a year) I
have
> >been leading Visual Basic projects.
> >
> >In the next week or so I will need to take a C++ Aptitude test. If the
test
> >is mostly syntax then I feel I will do very poorly. I do not have any
> >experience with the latest ANSI/ISO C++ Standard.
>
> I'd be interested in hearing about your experience. I assume you've
already
> taken the test?
>

> My first question would be why do you need to take one? Any employer that
> requires an "aptitude test" is one best avoided, in my not-so-humble
> opinion.

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Francis Glassborow

unread,
Mar 8, 2000, 3:00:00 AM3/8/00
to
In article <Xv%w4.43463$pN1.4...@news1.rdc1.nj.home.com>, Brett g
Porter <BgPo...@NOacmSPAM.org> writes

>Maybe, maybe not. I don't know about where you work, but for us, hiring the
>wrong person is _incredibly_ expensive.

And that is the reality. Until we have some way of certifying competence
in programming potential employees need to validate an applicants
claims. What annoys me is that many of these 'tests' are written by
people who are even less competent than the candidates.


>

Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

Mark

unread,
Mar 9, 2000, 3:00:00 AM3/9/00
to
Dean Roddey wrote in message ...

>I think maybe the difference of opinion is the nature of the test. Some
>places do this deal where you have to program something on the fly in front
>of them. To me, this is a complete waste of time. No one programs like that,
>and I don't think it says squat about a person's ability to produce high
>quality code. It might say something about there level of humility, and
>that's something interesting to know, but it would force out a lot of people
>who would be great programmers because they just don't handle that kind of
>situation well.

I think those tests discriminate against different personality
types, and it's not a well balanced test.

Some people are big picture people, who are much better
at designing software architectures, than writing code on
the fly.

There is more to the job than just coding C++. Some people
who are good at solving problems off the bat, are hopeless
at writing production quality code.

Cheers,
Mark.

Mark

unread,
Mar 9, 2000, 3:00:00 AM3/9/00
to
Rob Stewart wrote in message <38C573DF...@giage.com>...

>There are good and bad things about it, but I agree that testing
>is necessary.

I disagree. I think you can pretty much tell how competent
a person is by talking to them, especially for a technical
conversation.

>> > You don't ask a carpenter when you hire him if he could bang
>> > in a nail, just to prove that he can do it.
>>
>> True. But, are you saying that designing and writing good code is as simple
>> as banging a nail? I hope not.
>
>OTOH, a carpenter has been through an apprenticeship program. He
>can demonstrate compentency through documentation. We don't have
>much in the C++ world that is remotely similar.

Yes, but we are talking about qualified people with degrees
here. Isn't that enough? Surely they have demonstrated
enough intelligence to be able to code some C++, even
if they aren't 100% productive straight away? C++ is not
*that* difficult.

>> > I've recently been through this kind of thing and it's humiliating.
>>
>> It could be, but I wonder if your ego might have gotten in the way.

Maybe it did, but asking someone with 10+ years of experience
in software development to do this kind of thing is unecessary
IMHO. I would much rather they spoke to my previous employers
to get that kind of information - thats why references are supplied.

As soon as you plonk down your C++ test on the table, you
are saying to the prospective candidate, "Despite all the
evidence you have supplied, I don't believe anything you
have told me, you are a liar". Not the best of starts IMHO.


>> > In the end I got a job with a company who didn't ask me to do
>> > those tests, and I'm very happy there. The interviewers in many
>> > companies seemed to be more interested in proving how great
>> > they were, and I just wasn't interested.
>
>Perhaps the company that asked you to take a test was a poor
>company to work for. Fortunately, the one you hired with was a
>good company. it is coincidental that they didn't test you.

I don't believe it was coincidental. They were not any less
rigourous, they just went about things in a more respectful,
and considerate way.


>> > I walked out on one that asked me to code a tic/tac/toe puzzle
>> > on paper, and it felt good :-) Their loss, not mine.
>>
>> I did most of the technical evaluations at a company where I used to work.
>> I had one guy out of about seventy walk out on me, and afterwards I thought
>> it was *our* gain.

Well, something about my personality means that I don't
like to tackle pointless problems, to me it just seems like
wasted effort. Is there anyone else out there with this
personality disorder or is it just me? :-)

Actually, I didn't walk out, I was polite, but after that, I wasn't
interested in working for them. They had such a narrow
focus on coding it was unbelievable. I tried to explain to
them I didn't work like that, that I developed requirements
specifications, did system architecture and design, finally
coding then testing. However it fell on deaf ears, they were
only interested in C++ code.


>> I've had people with years of 'experience' tell me that a double quoted
>> string didn't have a NULL character at the end. And did you know C has an
>> exponentiation operator? It was news to me. Shoot, just last Friday I had
>> a woman rate herself an 8, on a scale of 1 to 10, in C++ and she couldn't
>> tell me what a copy constructor is. (She rated herself a 7 in C - I'm
>> always skeptical when I hear someone rate themselves higher in C++ than in C
>> because C++ is so much more complicated.) I've seen people who just
>> graduated with bachelor degrees and no real world experience outperform
>> people with a masters degrees and experience.

I don't think that's a fair test. People are often stressed out in
interviews and often forget things they know very well. Surely
you must know this from exam time at school?

I think it would be fairer to ask them to bring in a sample of their
best work, and ask them a few meaningful questions about it.

>The person with true experience
>has more to base decisions on. They may rely more on their tools
>than their recently fortified memory for syntax. It's hard to
>judge the ultimate benefit of the people you hire no matter what
>you do.

And also the person with true experience can see lots
of potential problems that the inexperienced person
won't. Something that appears simple, often isn't to
an expert.

>> You simply can't tell what people are capable of based on a piece of paper
>> and a casual conversation about past work. You have to delve into the
>> details to find out what people really know.

I think you can tell a lot from a technical conversation with someone,
but I would also back it up by researching their background and
discussing it with their previous employers.

However, many employers are *too lazy* to do this, hence the reliance
on coding tests.

Cheers,
Mark.

Andrei Alexandrescu

unread,
Mar 9, 2000, 3:00:00 AM3/9/00
to
Rob Stewart <donot...@giage.com> wrote in message
news:38C573DF...@giage.com...

> Some folks have an easier time than others recalling syntactic
> details. For proof, consider how many folks for whom English is
> a second language have better grammar than those for whom English
> is the first language. The former worked diligently to study the
> new language. The latter have found that they can get away with
> sloppiness and still communicate fairly well. Despite this, the
> latter are almost always better at expressing an idea in English
> than the former. This is because they are well versed in
> idiomatic usage, slang, cultural references, etc. that help to
> communicate the information. The former can't relate in those
> same ways w/o significant immersion in the listener's culture.
>
> The same happens with C++. A young college grad might know the
> syntax better, but hasn't been seasoned by experience to know how
> to apply it in many situations. The veteran may be better able
> to apply C++ to a situation, but may spend a fair bit of time
> fighting with the compiler to get something that compiles. The
> veterans code will often be easier to understand because of the
> application of common idioms and patterns, whereas the newbie's
> code may be trite or convoluted.

This is a nice and seducing comparison, but I cannot agree with it due to
field experience.

I think good programming skills have more to do with talent and one's
ability to express herself, than with what you mention.

What I saw with C++ "veterans" that don't cope well with the syntax, is that
they suck. They tend to apply a reduced set of language to every problem
they tackle with. To me, a C++ vet who has trouble with getting code to
compile due to sloppy syntax is not a vet, but an old fart.

In the other extreme of the spectrum of course are syntax freaks, and I'm
not advocating they are any better.

But a vet's code (according to your definition of vet) is bad because,
although it might be easy to understand at a micro level ("look, I don't do
anything unusual") is unncesessary big, complex, and intellectually
slow-paced because she doesn't know the syntax shortcuts that would make it
faster.

I think in C++, as in natural language, syntax, semantics, and pragmatics
cannot be separated. It's a package deal. You cannot excel at one while
being weak with another.

After all, have you seen any philosopher, writer, or poet who's making silly
grammar/syntax mistakes? No, Sir. They all master the language in all its
dimensions. I hasten to add that if there's any, that's an exception :o).


Andrei

Francis Glassborow

unread,
Mar 9, 2000, 3:00:00 AM3/9/00
to
In article <38C573DF...@giage.com>, Rob Stewart
<donot...@giage.com> writes

>The same happens with C++. A young college grad might know the
>syntax better, but hasn't been seasoned by experience to know how
>to apply it in many situations. The veteran may be better able
>to apply C++ to a situation, but may spend a fair bit of time
>fighting with the compiler to get something that compiles. The
>veterans code will often be easier to understand because of the
>application of common idioms and patterns, whereas the newbie's
>code may be trite or convoluted.

Let me be honest, I once did a test in C++ and was rated in the 99th
percentile and then could point out that the questions I had got wrong
were because the test had no right answers (those also lowered my speed
classification) but because I have no relevant industrial experience I
would not rate myself as a good potential employee. Knowing the language
and how to write it accurately is not the same as knowing what to write.
I will teach you the former but would never even attempt the latter.

The problem that I often see is job candidates who have neither good
programming language skills nor any understanding of what needs to be
expressed in whatever language is being used.


Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Rob Stewart

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
Mark wrote:
>
> Rob Stewart wrote in message <38C573DF...@giage.com>...

Actually, I didn't write all that was quoted and attributed to
me.

> >There are good and bad things about it, but I agree that testing
> >is necessary.
>
> I disagree. I think you can pretty much tell how competent
> a person is by talking to them, especially for a technical
> conversation.

We'll have to agree to disagree.

> >> > You don't ask a carpenter when you hire him if he could bang
> >> > in a nail, just to prove that he can do it.
> >>
> >> True. But, are you saying that designing and writing good code is as simple
> >> as banging a nail? I hope not.
> >
> >OTOH, a carpenter has been through an apprenticeship program. He
> >can demonstrate compentency through documentation. We don't have
> >much in the C++ world that is remotely similar.
>
> Yes, but we are talking about qualified people with degrees
> here. Isn't that enough? Surely they have demonstrated
> enough intelligence to be able to code some C++, even
> if they aren't 100% productive straight away? C++ is not
> *that* difficult.

I've interview and worked with many people with degrees and years
of experience who couldn't code their way out of a paper bag.
I've worked with many people who reached a certain level of
competency with C++ -- or any other language for that matter,
including English! -- and stopped growing. They learned enough
to get by and that suited them just fine. That's the reality.

If a company relies on a C++ test as their sole criterion, then
they are shortsighted. Nevertheless, you must ascertain the
extent of what someone has learned. If you are hiring a junior
developer, then their knowledge of C++ is less important; they
can learn on the job. If you are hiring a senior developer, then
you expect them to know their stuff -- right now -- to earn their
position and salary.

> >> > I've recently been through this kind of thing and it's humiliating.
> >>
> >> It could be, but I wonder if your ego might have gotten in the way.
>
> Maybe it did, but asking someone with 10+ years of experience
> in software development to do this kind of thing is unecessary
> IMHO. I would much rather they spoke to my previous employers
> to get that kind of information - thats why references are supplied.

Companies must do this too, but remember that a candidate will
only provide references they expect to get a favorable review
from -- or you don't want to hire them anyway! Consequently, you
can't put *too* much stock in those references.

> As soon as you plonk down your C++ test on the table, you
> are saying to the prospective candidate, "Despite all the
> evidence you have supplied, I don't believe anything you
> have told me, you are a liar". Not the best of starts IMHO.

No, it says, "put your money where your mouth is." I've
interviewed many people who thought they were C++ experts. They
were quite humbled when they finished. The test, which for me
includes Q&A as well as code reading, reveals just what and how
much they know. That can be used to determine salary and
responsibility upon hire.

> >Perhaps the company that asked you to take a test was a poor
> >company to work for. Fortunately, the one you hired with was a
> >good company. it is coincidental that they didn't test you.
>
> I don't believe it was coincidental. They were not any less
> rigourous, they just went about things in a more respectful,
> and considerate way.

An opinion I don't share. However, it does suggest that your
personality and that of the company requiring a test as *part* of
the interview process don't fit, so it is wise, for both parties,
that you go separate ways.

> >> > I walked out on one that asked me to code a tic/tac/toe puzzle
> >> > on paper, and it felt good :-) Their loss, not mine.
> >>
> >> I did most of the technical evaluations at a company where I used to work.
> >> I had one guy out of about seventy walk out on me, and afterwards I thought
> >> it was *our* gain.
>
> Well, something about my personality means that I don't
> like to tackle pointless problems, to me it just seems like
> wasted effort. Is there anyone else out there with this
> personality disorder or is it just me? :-)

It isn't a personality disorder, but it is a perspective problem,
IMO.

> Actually, I didn't walk out, I was polite, but after that, I wasn't
> interested in working for them. They had such a narrow
> focus on coding it was unbelievable. I tried to explain to
> them I didn't work like that, that I developed requirements
> specifications, did system architecture and design, finally
> coding then testing. However it fell on deaf ears, they were
> only interested in C++ code.

We've used design sessions, OO test/Q&A sessions, C++ test/Q&A
sessions, WIN32 test/Q&A sessions, etc., as part of extensive
interviews. This gives a well-rounded impression of the
candidate. If you object to being tested and questioned on
topics of importance to us, then you should go work somewhere
else; we'd like to know what you know. We'd also like to see how
you interact with people, how you manage a group, etc.

> >> I've had people with years of 'experience' tell me that a double quoted
> >> string didn't have a NULL character at the end. And did you know C has an
> >> exponentiation operator? It was news to me. Shoot, just last Friday I had
> >> a woman rate herself an 8, on a scale of 1 to 10, in C++ and she couldn't
> >> tell me what a copy constructor is. (She rated herself a 7 in C - I'm
> >> always skeptical when I hear someone rate themselves higher in C++ than in C
> >> because C++ is so much more complicated.) I've seen people who just
> >> graduated with bachelor degrees and no real world experience outperform
> >> people with a masters degrees and experience.
>
> I don't think that's a fair test. People are often stressed out in
> interviews and often forget things they know very well. Surely
> you must know this from exam time at school?

Some people can take tests and some can't. Nevertheless, the
hiring process is a test of the candidate. The interviewer(s)
should make it as comfortable as possible, but the candidate is
being scrutinized whether or not they like it.

> I think it would be fairer to ask them to bring in a sample of their
> best work, and ask them a few meaningful questions about it.

This can be telling, but you can also be sure they will -- if
they're the least bit intelligent -- make it as clean and pretty
as they can. IOW, it doesn't give you an accurate impression of
their normal work. Therefore, it is *some* information, but not
as valuable as you suggest.

> >> You simply can't tell what people are capable of based on a piece of paper
> >> and a casual conversation about past work. You have to delve into the
> >> details to find out what people really know.
>
> I think you can tell a lot from a technical conversation with someone,
> but I would also back it up by researching their background and
> discussing it with their previous employers.
>
> However, many employers are *too lazy* to do this, hence the reliance
> on coding tests.

And many employers do both.

--
Robert Stewart | rob-at-giage-dot-com
Software Engineer | using std::disclaimer;
Giage, Ltd. | http://www.giage.com

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Rob Stewart

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
Mark wrote:
>
> Dean Roddey wrote in message ...
> >I think maybe the difference of opinion is the nature of the test. Some
> >places do this deal where you have to program something on the fly in front
> >of them. To me, this is a complete waste of time. No one programs like that,
>
> I think those tests discriminate against different personality
> types, and it's not a well balanced test.

You're right. That's why the interview should include Q&A, mock
design sessions, discussions with references, etc.

> Some people are big picture people, who are much better
> at designing software architectures, than writing code on
> the fly.
>
> There is more to the job than just coding C++. Some people
> who are good at solving problems off the bat, are hopeless
> at writing production quality code.

If a company uses this kind of test for someone they expect to do
the architecture, then the artchitect candidate is *definitely*
wise to go elsewhere.

Brett g Porter

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to

"Mark" <nos...@anywhere.org> wrote in message
news:38c6b...@news2.cluster1.telinco.net...

> Rob Stewart wrote in message <38C573DF...@giage.com>...
>
> >There are good and bad things about it, but I agree that testing
> >is necessary.
>
> I disagree. I think you can pretty much tell how competent
> a person is by talking to them, especially for a technical
> conversation.
Bah!
You must not have interviewed many job candidates. Without seeing code, all
you can determine in a conversation is buzzword-compliance. Since you're big
on 'personality types' you must recognize that just as there are people who
don't test well, there are people who don't interview well.


> Yes, but we are talking about qualified people with degrees
> here. Isn't that enough? Surely they have demonstrated
> enough intelligence to be able to code some C++, even
> if they aren't 100% productive straight away? C++ is not
> *that* difficult.

Why would I waste a spot on my team with someone who's going to need their
hand held, when I could just as easily hire someone who can hit the ground
running? We don't require degrees, we just require ability and attitude.

> Maybe it did, but asking someone with 10+ years of experience
> in software development to do this kind of thing is unecessary
> IMHO. I would much rather they spoke to my previous employers
> to get that kind of information - thats why references are supplied.

I've seen people hired on that basis and it quickly became apparent that
they must have lasted at each job just long enough for their lack of ability
to be recognized and acted on. There are a lot of big shops where it's
fairly easy to hide in a cube and skate along without being noticed. (And
often previous employers are so happy to be rid of these types that their
recommendations are a bit tainted.)

todd...@my-deja.com

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
In article <38c6b...@news2.cluster1.telinco.net>,

"Mark" <nos...@anywhere.org> wrote:
> Maybe it did, but asking someone with 10+ years of experience
> in software development to do this kind of thing is unecessary
> IMHO. I would much rather they spoke to my previous employers
> to get that kind of information - thats why references are supplied.

If anyone says anything negative in a reference then they
are stupid beyond belief, at least in the US.

> As soon as you plonk down your C++ test on the table, you
> are saying to the prospective candidate, "Despite all the
> evidence you have supplied, I don't believe anything you
> have told me, you are a liar". Not the best of starts IMHO.

Trust but verify.

A large percentage of people i have interviewed do in fact lie
in their resumes. And you only know that by verifying
their knowledge with concrete questions. Just because a person
can't answer a question doesn't mean they won't get the job,
but it does tell you something about what their strengths are.
It's important to know if a person is a big picture person,
wizard coder, or something else. A team needs all kinds of
people, but it doesn't need liars.


Sent via Deja.com http://www.deja.com/
Before you buy.

David Dillard

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
"Mark" <nos...@anywhere.org> wrote in message
news:38c6b...@news2.cluster1.telinco.net...

> >OTOH, a carpenter has been through an apprenticeship program. He
> >can demonstrate compentency through documentation. We don't have
> >much in the C++ world that is remotely similar.
>
> Yes, but we are talking about qualified people with degrees
> here. Isn't that enough? Surely they have demonstrated
> enough intelligence to be able to code some C++, even
> if they aren't 100% productive straight away? C++ is not
> *that* difficult.

We are talking about people with degrees (usually). If they're qualified is
what we're trying to determine.

> >> > I've recently been through this kind of thing and it's humiliating.
> >>
> >> It could be, but I wonder if your ego might have gotten in the way.
>
> Maybe it did, but asking someone with 10+ years of experience
> in software development to do this kind of thing is unecessary
> IMHO. I would much rather they spoke to my previous employers
> to get that kind of information - thats why references are supplied.

I've dealt with a number of people with 10+ years of experience who I
wouldn't hire. Don't forget that an employer has to pay for that
experience, the employer needs to know that they're getting their moneys
worth.

Personally, I believe references are practically useless. Have you ever
worked with someone who you thought was unqualified to be doing what they
were doing? I have. Do you think they had "good" references? Sure, they
did.

> As soon as you plonk down your C++ test on the table, you
> are saying to the prospective candidate, "Despite all the
> evidence you have supplied, I don't believe anything you
> have told me, you are a liar". Not the best of starts IMHO.

I think you're being waaayyy to sensitive. Nobody's saying you're a liar.
But, just because you believe you're capable of something doesn't mean I do.
Often, its a calibration issue. For example, the woman I mentioned in my
previous post who rated herself an 8 of 10 in C++. She probably does
believe that's an accurate reflection of her abilities. After talking with
her I disagree. There are two issues: one is honesty, the other competence.
Interestingly, there is a recently released study that says that people who
are incompetent often don't realize they are incompetent. Should I trust
the honest, but incorrect, opinion of an incompetent person? I don't think
so. Judging your competence is just one of many the reasons for doing
interviews.

> >Perhaps the company that asked you to take a test was a poor
> >company to work for. Fortunately, the one you hired with was a
> >good company. it is coincidental that they didn't test you.
>
> I don't believe it was coincidental. They were not any less
> rigourous, they just went about things in a more respectful,
> and considerate way.

You view it as being disrespectful because you have to demonstrate what your
capable of?

> >> I did most of the technical evaluations at a company where I used to
work.
> >> I had one guy out of about seventy walk out on me, and afterwards I
thought
> >> it was *our* gain.
>
> Well, something about my personality means that I don't
> like to tackle pointless problems, to me it just seems like
> wasted effort. Is there anyone else out there with this
> personality disorder or is it just me? :-)

Its not pointless if you want to get the job. Most people like to show off
their abilities.

> Actually, I didn't walk out, I was polite, but after that, I wasn't
> interested in working for them. They had such a narrow
> focus on coding it was unbelievable. I tried to explain to
> them I didn't work like that, that I developed requirements
> specifications, did system architecture and design, finally
> coding then testing. However it fell on deaf ears, they were
> only interested in C++ code.

Writing code is one of the things that can be relatively easily tested in an
interview setting. I agree that the other things you mentioned are
important, however they are much more difficult to test. Also, the place
where you interviewed may not have valued things like requirements
specifications (unfortunate, but true).

> >> I've had people with years of 'experience' tell me that a double quoted
> >> string didn't have a NULL character at the end. And did you know C has
an
> >> exponentiation operator? It was news to me. Shoot, just last Friday I
had
> >> a woman rate herself an 8, on a scale of 1 to 10, in C++ and she
couldn't
> >> tell me what a copy constructor is. (She rated herself a 7 in C - I'm
> >> always skeptical when I hear someone rate themselves higher in C++ than
in C
> >> because C++ is so much more complicated.) I've seen people who just
> >> graduated with bachelor degrees and no real world experience outperform
> >> people with a masters degrees and experience.
>
> I don't think that's a fair test. People are often stressed out in
> interviews and often forget things they know very well. Surely
> you must know this from exam time at school?

Actually, I was a good test taker so I really don't remember. But, a
candidate's perceived stress level is taken into account when doing the test
(that I gave - I can easily conceive of situations where it wouldn't be).
Most people with experience don't get too nervous. I have seen a few kids
fresh out of college who were shaking, their voices quivering. People like
that who we saw enough good things in we'd bring back for a second interview
in which they we hoped they'd be more relaxed.

As far as the things above not being fair for a test I just plain disagree.
These are simple things - yes someone can be nervous. But, I trust what I
see much more than what someone tells me. If you think this is unfair you
would've really hated the interview I had when I applied for my current
job - one question started "Write the declaration for a function that
returns a pointer to a function..."

There are many things that can be learned about a candidate, beyond their
knowledge of syntax, when giving an *interactive* test if the person giving
the test knows what to look for, the questions to ask, and how to ask them.

> I think it would be fairer to ask them to bring in a sample of their
> best work, and ask them a few meaningful questions about it.

That's a good part of an interview, but I wouldn't replace testing with
this.

> >> You simply can't tell what people are capable of based on a piece of
paper
> >> and a casual conversation about past work. You have to delve into the
> >> details to find out what people really know.
>
> I think you can tell a lot from a technical conversation with someone,
> but I would also back it up by researching their background and
> discussing it with their previous employers.

Well, my experience doesn't agree with this. I've done evals on people who
did good in their interviews, had good references, but weren't worth the
money we'd have to pay to hire them.

> However, many employers are *too lazy* to do this, hence the reliance
> on coding tests.

Ah, name calling.

David Dillard

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
"Mark" <nos...@anywhere.org> wrote in message
news:38c6b...@news2.cluster1.telinco.net...
> Dean Roddey wrote in message ...
> >I think maybe the difference of opinion is the nature of the test. Some
> >places do this deal where you have to program something on the fly in
front
> >of them. To me, this is a complete waste of time. No one programs like
that,
> >and I don't think it says squat about a person's ability to produce high
> >quality code. It might say something about there level of humility, and
> >that's something interesting to know, but it would force out a lot of
people
> >who would be great programmers because they just don't handle that kind
of
> >situation well.
>
> I think those tests discriminate against different personality
> types, and it's not a well balanced test.

I agree.

> Some people are big picture people, who are much better
> at designing software architectures, than writing code on
> the fly.
>
> There is more to the job than just coding C++. Some people
> who are good at solving problems off the bat, are hopeless
> at writing production quality code.

I agree again. But, if an employer is hiring someone to write code and they
"are hopeless at writing production quality code." don't you think they
should know that ahead of time?


--- David

Mike Smith

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
Mark <nos...@anywhere.org> wrote in message
news:38c6b...@news2.cluster1.telinco.net...

> As soon as you plonk down your C++ test on the table, you
> are saying to the prospective candidate, "Despite all the
> evidence you have supplied, I don't believe anything you
> have told me, you are a liar". Not the best of starts IMHO.

Do you feel the same way about making policemen take a test before they are
hired? "Uh, yeah, I know all about guns, and law, and stuff. Yeah, sure I
know when to shoot, and when not to shoot. Can I be a policeman now?"
Hell, why make lawyers pass the Bar Exam? They went to college, and read
lots of thick books, right? Or doctors? Or PEs? When I interview
candidates, I don't use a full-on *exam*, but even a few seemingly-innocuous
technical questions (simple stuff, like "what are the ramifications of
declaring a base class member function as 'virtual'?", or "what is the
'volatile' [or 'const'] keyword used for?") can be very enlightening -- very
often, people with impressive-looking resumes, and who can talk the talk
during interviews, are sorely lacking in basic technical knowledge.

--
Mike Smith

There are perhaps 5% of the population that simply *can't* think.
There are another 5% who *can*, and *do*.
The remaining 90% *can* think, but *don't*.
-- R. A. Heinlein

David Dillard

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
"Jonathan Calvert" <jonathanNO-SPAM...@mindspring.com> wrote in
message news:8a4jlg$je0$1...@slb6.atl.mindspring.net...

> For the record, some one emailed me a testing site: www.brainbench.com
>
> I only scored a 2.84 on a scale of 1-5 (5 being the highest) on the C++
> test. I am not sure how difficult folks in this group would rate the C++
> test. There were several OO questions that I did not know because of lack
> of experience. I am sure that I missed many questions due to "being rusty
> in C++". I am very good with a debugger so I am sure that I could
determine
> the right answer or the syntax problem in a "real life setting".

I just took that test. Some parts of it seemed wholly inappropriate for a
test on C++ (the OODBMS stuff and the three tiered development stuff).
Also, there were several questions that I'm pretty sure they screwed up on
and the correct answer was not one of the choices. The one that sticks in
my head right now is the memory leak of arrays allocated in a constructor.
I selected that the best way to fix the problem was to use auto_ptrs, but
auto_ptrs don't work with arrays! If they did it would have been the best
answer, and no other answer seemed correct so that was the answer I chose.
I figured they didn't necessarily know what they were talking about.

I scored a 4.02 so, according to them, I'm a Certified Master C++ Programmer
(ooohhh-aaahhh ;-))


--- David

Chip Olson

unread,
Mar 11, 2000, 3:00:00 AM3/11/00
to
In article <8a4jlg$je0$1...@slb6.atl.mindspring.net>, Jonathan Calvert wrote:

>For the record, some one emailed me a testing site: www.brainbench.com

I utterly astonished myself by scoring a 3.76 (out of 5) on the C++/OO
test, and even more by getting a 4.7 on the OO component. I can state
with great confidence that this is *not* an accurate assessment of my
skills, other than my skill at taking multiple-choice tests. Others
with a far more thorough understanding of C++ and object-priented
analysis and design, but not as good at figuring out the correct
answer out of several choices, might very easily not do as
well. Having several good references to hand (which is explicitly
permitted) helped some, but not a lot.

By way of background, I've been a professional C++ programmer for
almost 3 years now, but 2 of those were spent in a tiny shop where I
was the only one using C++, and it was with MFC at that (which is a
*huge* impediment to learning good C++ programming practices,
IMHO). So I'm frantically clawing my way up the steep part of the
learning curve. A large percentage of the questions, particularly in
the OO section, involved concepts I've never been exposed to.

So I'd say the usefulness of C++ aptitude tests varies radically
depending on both the way the test is structured and the way the
applicant thinks. If someone hands me a multiple-choice test like this
one, I'll do fine, but if they ask me to explain the same concepts,
I'll just start whimpering. Others might have an opposite reaction.

--
-Chip Olson. | ceo at shore dot net
"You ask me why we celebrate, when nothing has been won;
We take dark hours, we make them great, that's all we've ever done..."
-Oysterband, "This Is The Voice".

Stan Brown

unread,
Mar 11, 2000, 3:00:00 AM3/11/00
to
Said nos...@anywhere.org (Mark) in comp.lang.c++.moderated:

>Maybe it did, but asking someone with 10+ years of experience
>in software development to do this kind of thing is unecessary
>IMHO.

The difficulty is that people lie about their experience, and you
have no way to know who's lying. When a client asked me to help
in technical evaluations, I made up a test but administered it
orally not in writing. These were not obscure things like whether
fflush() works on input streams or the exact order of integral
promotions; and I took pains to put candidates at their ease and
not rattle them. You would not believe the number of C
programmers -- supposedly with 3 to 5 years' experience! -- who
could not tell me the difference between ++i and i++, or between
while and do-until.

I have no reason to think the situation is any better with C++.

>I would much rather they spoke to my previous employers
>to get that kind of information - thats why references are supplied.

This is not practical in many (most?) situations in the US. Many
employers will give no information about performance of past
employees, for fear of lawsuits. They'll confirm the employee
worked there, and the dates, and that's it. And in any event you
cannot contact the current employer because the employee is still
working there.

>As soon as you plonk down your C++ test on the table, you
>are saying to the prospective candidate, "Despite all the
>evidence you have supplied, I don't believe anything you
>have told me, you are a liar". Not the best of starts IMHO.

No, you are saying, "Unfortunately there are a lot of people out
there who misrepresent their abilities -- or whose placement
firms misrepresent them. This is far from perfect, but at least
weeds out the people who claim five years' experience with C++
yet know little or nothing about the language."

--
Stan Brown, Oak Road Systems, Cleveland, Ohio, USA
http://www.mindspring.com/~brahms/
C++ FAQ Lite: http://www.cerfnet.com/~mpcline/c++-faq-lite/
the C++ standard: http://webstore.ansi.org/
more FAQs: http://www.mindspring.com/~brahms/faqget.htm

Francis Glassborow

unread,
Mar 11, 2000, 3:00:00 AM3/11/00
to
<nos...@anywhere.org> writes

>Yes, but we are talking about qualified people with degrees
>here. Isn't that enough? Surely they have demonstrated
>enough intelligence to be able to code some C++, even
>if they aren't 100% productive straight away? C++ is not
>*that* difficult.

The only person I have ever had to suggest abandoned a C++ course being
presented by me had a CS degree. He had managed to obtain a degree
without actually doing any programming:(


Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Francis Glassborow

unread,
Mar 11, 2000, 3:00:00 AM3/11/00
to
In article <scdebdk...@news.supernews.com>, Andrei Alexandrescu
<andre...@hotmail.com> writes

>After all, have you seen any philosopher, writer, or poet who's making silly
>grammar/syntax mistakes? No, Sir. They all master the language in all its
>dimensions. I hasten to add that if there's any, that's an exception :o).

You might be surprised by the degree to which some professional writers
rely on their secretaries, copy editors etc. :)


Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Francis Glassborow

unread,
Mar 11, 2000, 3:00:00 AM3/11/00
to
In article <cZTx4.3918$u8.1...@newsread2.prod.itd.earthlink.net>, Mike
Smith <msm...@NOSPAMkldlabs.com> writes

>I don't use a full-on *exam*, but even a few seemingly-innocuous
>technical questions (simple stuff, like "what are the ramifications of
>declaring a base class member function as 'virtual'?", or "what is the
>'volatile' [or 'const'] keyword used for?") can be very enlightening -- very
>often, people with impressive-looking resumes, and who can talk the talk
>during interviews, are sorely lacking in basic technical knowledge.

Yes the perspective of those who have interviewed can be very different
from those who have only been interviewees. I wonder how the latter
would feel if they did not get a job they were well qualified for
because the employer selected someone else who had a sparkling though
fictional resume?

Almost any anyone rates themselves at between 7 and 9 out of 10,
depending on how much they know off without being able to do. This is
not dishonesty just ignorance. Claiming 10 is claiming what few of us
would ever claim (I know substantially all there is to know about the
subject) and claiming less than 6 would be surprising because it would
indicate that the claimant was aware that they were ignorant of at least
as much as they could do. Actually I might be far more interested in
someone who rated themselves as 3 or 4 than someone rating themselves as
8 or 9. The former know they have a lot to learn, and are likely to be
willing to do so.


Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Rob Stewart

unread,
Mar 12, 2000, 3:00:00 AM3/12/00
to
David Dillard wrote:
>
> "Jonathan Calvert" <jonathanNO-SPAM...@mindspring.com> wrote in
> message news:8a4jlg$je0$1...@slb6.atl.mindspring.net...
> > For the record, some one emailed me a testing site: www.brainbench.com
> >
> > I only scored a 2.84 on a scale of 1-5 (5 being the highest) on the C++
> > test. I am not sure how difficult folks in this group would rate the C++
> > test. There were several OO questions that I did not know because of lack
> > of experience. I am sure that I missed many questions due to "being rusty
> > in C++". I am very good with a debugger so I am sure that I could
> determine
> > the right answer or the syntax problem in a "real life setting".
>
> I just took that test. Some parts of it seemed wholly inappropriate for a
> test on C++ (the OODBMS stuff and the three tiered development stuff).
> Also, there were several questions that I'm pretty sure they screwed up on
> and the correct answer was not one of the choices. The one that sticks in
> my head right now is the memory leak of arrays allocated in a constructor.
> I selected that the best way to fix the problem was to use auto_ptrs, but
> auto_ptrs don't work with arrays! If they did it would have been the best
> answer, and no other answer seemed correct so that was the answer I chose.
> I figured they didn't necessarily know what they were talking about.

I forgot about that one. I answered it the same way for the same
reason.

> I scored a 4.02 so, according to them, I'm a Certified Master C++ Programmer
> (ooohhh-aaahhh ;-))

I got a 4.55. Whoopee!

--
Robert Stewart | rob-at-giage-dot-com
Software Engineer | using std::disclaimer;
Giage, Ltd. | http://www.giage.com

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Erik Max Francis

unread,
Mar 12, 2000, 3:00:00 AM3/12/00
to
Stan Brown wrote:

> The difficulty is that people lie about their experience, and you
> have no way to know who's lying. When a client asked me to help
> in technical evaluations, I made up a test but administered it
> orally not in writing. These were not obscure things like whether
> fflush() works on input streams or the exact order of integral
> promotions; and I took pains to put candidates at their ease and
> not rattle them. You would not believe the number of C
> programmers -- supposedly with 3 to 5 years' experience! -- who
> could not tell me the difference between ++i and i++, or between
> while and do-until.

Indeed. Worst of all is when non-technical people interview potential
programmers. They don't know what to ask, and they barely know the key
words to ask interviewees. At a company I worked at, a number of duds
got hired, and they didn't even really lie; the interviewer failed to
note that "API" can refer to a lot of different things, for instance.

As you say, horribly complex and nitpicking questions are not required,
just basic ones. A friend of mine had a standard question that he asked
all applicants: "Write a C [or C++, whatever was relevant] program that
prints, 'Hello, world.'" He was amazed at the number of people who
simply couldn't do it.

> This is not practical in many (most?) situations in the US. Many
> employers will give no information about performance of past
> employees, for fear of lawsuits.

I'm not familiar with any employer who condones answering these types of
questions -- even the HR people asking the questions know full well that
they can't be answered. More competent HR people are careful to not ask
questions that refer to the applicant's performance.

> No, you are saying, "Unfortunately there are a lot of people out
> there who misrepresent their abilities -- or whose placement
> firms misrepresent them. This is far from perfect, but at least
> weeds out the people who claim five years' experience with C++
> yet know little or nothing about the language."

I think a full-fledged examination (with pencils and paper, locked in a
conference room for an hour) is a little much. Certainly a few basic
questions are in order. I've never heard of a programmer that wouldn't
_expect_ a few technical questions at the very least -- nothing fancy,
just a basic sanity test.

--
Erik Max Francis | email m...@alcyone.com | icq 16063900
Alcyone Systems | web http://www.alcyone.com/max/ | q3a Product
San Jose, CA | languages en, eo | icbm 37 20 07 N 121 53 38 W
USA | 966.910 Ms p.L. | 296 days left | &tSftDotIotE
__
/ \ That it will never come again is what makes life so sweet.
\__/ Emily Dickinson

Hendrik Schober

unread,
Mar 14, 2000, 3:00:00 AM3/14/00
to
Mike Smith <msm...@NOSPAMkldlabs.com> wrote:
> [...]

> Do you feel the same way about making policemen take a test before they are
> hired? "Uh, yeah, I know all about guns, and law, and stuff. Yeah, sure I
> know when to shoot, and when not to shoot. Can I be a policeman now?"
> Hell, why make lawyers pass the Bar Exam? They went to college, and read
> lots of thick books, right? Or doctors? Or PEs?

There's one difference, though: Once a lawyer
passed his exams I don't think he will have to
deal with silly tests in job interviews.

I wouldn't say, all tests are stupid. But I
think asking a question during the interview
-- along the lines of what you quote below --
is a lot better than asking some one in a very
special and stressy situation to write code
without the usual tools at hand.

> When I interview
> candidates, I don't use a full-on *exam*, but even a few seemingly-innocuous


> technical questions (simple stuff, like "what are the ramifications of
> declaring a base class member function as 'virtual'?", or "what is the
> 'volatile' [or 'const'] keyword used for?") can be very enlightening -- very
> often, people with impressive-looking resumes, and who can talk the talk
> during interviews, are sorely lacking in basic technical knowledge.
>

> Mike Smith

Schobi

--
bitb...@gmx.de is never read
I'm hschober at gmx dot de

Hendrik Schober

unread,
Mar 14, 2000, 3:00:00 AM3/14/00
to
David Dillard <ddil...@usa.net> wrote:
> [...] one question started "Write the declaration for a function that

> returns a pointer to a function..."

I would first tell them that I'm rarely ever
using function pointers since, when using
function objects, the compiler does most of
the job. Second, I'd tell them I always write
this in steps, one typedef at a time. Not
neccessarely for me, but for the maintainers
that come after me. Then I'd ask if they're
still interested in that syntax wizardry.

If they were, which means they didn't share
my opinions about what easy to maintain code
is, I probably would write the declaration
down (all in one piece, if they really want),
but I'm afraid they'd failed _my_ test.

There's too much code out there written by
people who knew how to write such declarations
but didn't know how to get rid of it.
IMHO there's much more important stuff you
should know (and interviewers should test for).

> [...]

Schobi

--
bitb...@gmx.de is never read
I'm hschober at gmx dot de

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Siemel B. Naran

unread,
Mar 14, 2000, 3:00:00 AM3/14/00
to
On 14 Mar 2000 07:51:51 -0500, Hendrik Schober <bitb...@gmx.de> wrote:
>David Dillard <ddil...@usa.net> wrote:

>> [...] one question started "Write the declaration for a function that


>> returns a pointer to a function..."
>

> I would first tell them that I'm rarely ever
> using function pointers since, when using
> function objects, the compiler does most of
> the job. Second, I'd tell them I always write
> this in steps, one typedef at a time. Not
> neccessarely for me, but for the maintainers
> that come after me. Then I'd ask if they're
> still interested in that syntax wizardry.

This is an excellent response. However, I would
have approached the question differently: First
I'd try to answer their question directly as it
is more polite than imposing your design on
them. Next I would I move on to the other
considerations, giving specific declarations and
thorough explanations, and always thinking out
aloud.


First, I'd answer the actual question asked. If
I knew what the answer was, I'd write it out.
For example,
void (*get())(int,int);
// 'get' returns a function-pointer
// with signature "void something(int,int)"
Otherwise I would say that I don't know what the
answer is. (All is not lost if you don't know.)

Second, I'd mention your second point above
because it is more closely related to the
question asked -- namely that it is easier for
maintainance if we define a typedef
void (*Fptr)(int,int)
and then define 'get' as returning a Fptr.

Third, I'd mention your first point above --
that is usually better to return a function
object with an operator(...) or exec(...)
because objects are more powerful than
functions. They can hold private data and
typdefs. Unfortunately, if function 'get'
must return several function objects, then
we must return an abstract functor.
std::auto_ptr<Functor> get();
In function 'get' we create a concrete
functor and return a pointer to its base
class. We don't have to say this, but in
our function declaration above we've dealt
with the problem of deleting the dynamic
memory of creating a new Functor.

If you remember templates, mention this:
Another possibility is to make get a
template function, as in
template <class Functor> Functor get();

> If they were, which means they didn't share
> my opinions about what easy to maintain code
> is, I probably would write the declaration
> down (all in one piece, if they really want),
> but I'm afraid they'd failed _my_ test.

Maybe they're asking you a ridiculous question
on purpose. To see how you fit into a legacy
system, and whether you have the insight to
break out of it.

--
--------------
siemel b naran
--------------

Hendrik Schober

unread,
Mar 15, 2000, 3:00:00 AM3/15/00
to
"Siemel B. Naran" <sbn...@uiuc.edu> wrote:
> On 14 Mar 2000 07:51:51 -0500, Hendrik Schober <bitb...@gmx.de> wrote:
> [...]

> > If they were, which means they didn't share
> > my opinions about what easy to maintain code
> > is, I probably would write the declaration
> > down (all in one piece, if they really want),
> > but I'm afraid they'd failed _my_ test.
>
> Maybe they're asking you a ridiculous question
> on purpose. To see how you fit into a legacy
> system, and whether you have the insight to
> break out of it.

I see your point. Maybe I shouldn't be too harsch
with these employers. ;^)

OTOH, I'm kinda sick of these "legacy systems",
and probably won't do good anyway. Recently I've
been asked to work on some systems that, if there
wasn't micro economics, IMO should have been
dumped into the trash bin right away. The problems
were explained to me as "legacy", but none of these
systems had been older than three or four years.
(Plus they'd been developed on compilers that provide
"advanced" features like exceptions, templates etc.
for longer than this.)

> siemel b naran

Schobi

--
bitb...@gmx.de is never read
I'm hschober at gmx dot de

Thaddeus L. Olczyk

unread,
Mar 16, 2000, 3:00:00 AM3/16/00
to
On 7 Mar 2000 07:53:06 -0500, "Brett g Porter"
<BgPo...@NOacmSPAM.org> wrote:

>
>"Mark" <nos...@anywhere.org> wrote in message

>news:38c42...@news2.cluster1.telinco.net...
>> brou...@yahoo.com wrote in message ...


>> >"Jonathan Calvert" <jonathanNO-SPAM...@mindspring.com> wrote:
>> >
>> >My first question would be why do you need to take one? Any employer
>that
>> >requires an "aptitude test" is one best avoided, in my not-so-humble
>> >opinion.
>>

>> I couldn't agree more, especially when you are experienced.


>> You don't ask a carpenter when you hire him if he could bang
>> in a nail, just to prove that he can do it.

>I couldn't agree less. We require a programming test before even doing a
>phone interview. I review these tests occasionally, and it's not uncommon to
>see people with impressive resumes a mile long submit code that looks like
>they sneezed C++ tokens onto the screen. I've seen college students write
>rock-solid code. Hm -- do I want to hire for 'experience' or ability? (scare
>quotes intentional)
>
I no longer take tests unless they allow me to use my laptop.
Your statement makes some sense-- except-- when writting
in the VC++ or Borland BCB editors I produce crappy looking
code, but with emacs I don't.

As for the the tests themselves. The employers that want them the most
are the least capable to administer a good one.

Thaddeus L. Olczyk

unread,
Mar 16, 2000, 3:00:00 AM3/16/00
to
On 8 Mar 2000 18:36:06 -0500, Francis Glassborow
<fra...@robinton.demon.co.uk> wrote:

>In article <Xv%w4.43463$pN1.4...@news1.rdc1.nj.home.com>, Brett g
>Porter <BgPo...@NOacmSPAM.org> writes
>>Maybe, maybe not. I don't know about where you work, but for us, hiring the
>>wrong person is _incredibly_ expensive.
>
>And that is the reality. Until we have some way of certifying competence
>in programming potential employees need to validate an applicants
>claims. What annoys me is that many of these 'tests' are written by
>people who are even less competent than the candidates.
>
>

I used to think that certification would be good. But who would right
the certification criteria and the certification tests? The same
people that write those lousy tests.

IOW what gaurantee is a MSCE that you are actually competent in
windows?

Courageous

unread,
Mar 17, 2000, 3:00:00 AM3/17/00
to

I give a very simple test, which most of our candidates of late
(these are people with CS degrees from major institutions) have
been failing. The questions are extraordinarily simple.

1. This .C file has a function call f(i) in which the argument
is modified. The would be job seeker is to correctly identify
that for i to be passed by reference, it either must be
converted to a pointer (and f redefined to accept a pointer)
or f must be redefined to have a C++ style reference argument.

2. The candidate is to correctly identify that a memory allocation
line does not allocate enough room for the trailing NULL on a
string.

3. In a deviation of 1, the function call f(i) is altered to f(p),
where p is a char*. The candidate is to correctly identify that
for the memory allocation line in the function f() to work, p
must either be passed f(&p) or f must be modified so that its
argument is declared as a reference.

4. The candidate must correctly predict the output of a program
which makes use of a simple virtual function and an instance
of a derived class which has been cast to its base. This
demonstrates trivial understanding of virtual functions.

5. The candidate must correctly debug a C++ program in which a
derived object is created, but then cast to its base class
and then freed by delete(). One correct solution -- the best
one -- is to make the destructor in the base class virtual.

6. The candidate must demonstrate working knowledge of left
shift, bitwise or, and bitwise and. The candidate must
demonstrate understanding of bitfield manipulation, where
individual bits in a 16 bit integer are set and detected
for.

7. The candidate must write a function which prints from 1 to
100 and back to 1 without making use of for, while, goto,
or any looping constructs what-so-ever.

8. The candidate must be able to correctly predict (and
explain) the output of a program in which a function
pointer is passed to one function which in turn invokes
the function that the function pointer points to.
Candidates aren't required to write the syntax of
function pointers, only to be able to read it.

I welcome feedback from anyone that has any recommendations.


C/

Roger Tobin Reyelts

unread,
Mar 18, 2000, 3:00:00 AM3/18/00
to
Courageous <jkra...@san.rr.com> wrote:

[ test questions ]

These questions seem simple to me, and I would have been able to
answer most of them upon graduating high school, so something seems wrong
if a lot of people are failing your test. Are you sure you are presenting the
questions in a manner that the candidates understand?

Your goal should be to discover what the candidates understand,
not how well they can answer a particular question formed a particular
way. I find that making the questions more open ended allows candidates
to really expound on a subject and demonstrate (or not demonstrate)
their comprehension of a subject.

For example, instead of saying,

>7. The candidate must write a function which prints from 1 to
> 100 and back to 1 without making use of for, while, goto,
> or any looping constructs what-so-ever.

ask them if they have ever heard of recursion, and if so, to
write a code snippet that demonstrates it. Ask them why they would use
recursion instead of iteration. It's also nice to find out if the candidate
has ever used the concept in any project they've worked on.

Being straight-forward has really helped us in our interview
process, and I believe we have let fewer qualified candidates slip through
our fingers, while doing a better job of not hiring those who aren't
appropriately qualified.

Tests are a good way to begin the interview process, but its the
actual free-form discussion of the answers with the candidates that I find
to be, by far, the most revealing.

God bless,
-Toby Reyelts
--
Toby Reyelts
331107 Georgia Tech Station Atlanta Georgia 30332-1365
Internet: gt1...@prism.gatech.edu

Francis Glassborow

unread,
Mar 18, 2000, 3:00:00 AM3/18/00
to
In article <38D1E33A...@san.rr.com>, Courageous
<jkra...@san.rr.com> writes

>7. The candidate must write a function which prints from 1 to
> 100 and back to 1 without making use of for, while, goto,
> or any looping constructs what-so-ever.

If that last condition is true then I cannot imagine (OK I am sometimes
a bit short of imagination) what you expect as a solution to that
problem. Are you really expecting the programmer to use some form of
recursion?


Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Anders J. Munch

unread,
Mar 18, 2000, 3:00:00 AM3/18/00
to
Courageous wrote in message <38D1E33A...@san.rr.com>...

>
>I give a very simple test, which most of our candidates of late
8>(these are people with CS degrees from major institutions) have

>been failing. The questions are extraordinarily simple.

Reasonable questions, all in all. I have just a few comments.

>4. The candidate must correctly predict the output of a program
> which makes use of a simple virtual function and an instance
> of a derived class which has been cast to its base. This
> demonstrates trivial understanding of virtual functions.


I hope that is not to be taken literally, as in:
int main()
{
Derived d;
((Base)d).vfn();
}

-which involves some of the more esoteric parts of C++.

I hope you mean something like:
void f(Base& b) { b.vfn(); }
int main()


Derived d;
f(d);
}

>6. The candidate must demonstrate working knowledge of left
> shift, bitwise or, and bitwise and. The candidate must
> demonstrate understanding of bitfield manipulation, where
> individual bits in a 16 bit integer are set and detected
> for.


I think most schools do not teach this explicitly -- which may make it a
better indiciator for practical programming experience.

>
>7. The candidate must write a function which prints from 1 to
> 100 and back to 1 without making use of for, while, goto,
> or any looping constructs what-so-ever.


How much time do you allot to this question? I mean, writing 200 C++
statements takes time :O)

I think you should make it clearer that you are looking for a solution
using recursion, or you'll risk the candidates being confused about what
you want from them. E.g. you could ask them to use function calls and
if-statements instead of looping constructs.

--
Anders Munch, ande...@post.tele.dk
Still confused but at a higher level.

Dietmar Kuehl

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to
Hi,
In article <S6FxSKAD...@robinton.demon.co.uk>,

Francis Glassborow <fran...@robinton.demon.co.uk> wrote:
> In article <38D1E33A...@san.rr.com>, Courageous
> <jkra...@san.rr.com> writes
> >7. The candidate must write a function which prints from 1 to
> > 100 and back to 1 without making use of for, while, goto,
> > or any looping constructs what-so-ever.
>
> If that last condition is true then I cannot imagine (OK I am
> sometimes
> a bit short of imagination) what you expect as a solution to that
> problem. Are you really expecting the programmer to use some form of
> recursion?

Here is a non-recursive version which does not use any looping
construct:

#include <algorithm>
#include <vector>
#include <iterator>
#include <iostream>

static int const count = 100;

int up() {
static int rc = 1;
return rc++;
}

int down() {
static int rc = count;
return rc--;
}

int main() {
std::generate_n(std::ostream_iterator<int>(std::cout, "\n"),
count, up);
std::generate_n(std::ostream_iterator<int>(std::cout, "\n"),
count, down);
}
--
<mailto:dietma...@claas-solutions.de>
homepage: <http://www.informatik.uni-konstanz.de/~kuehl>


Sent via Deja.com http://www.deja.com/
Before you buy.

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Yura Koblents-Mishke

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to

Roger Tobin Reyelts wrote:
>
> Courageous <jkra...@san.rr.com> wrote:

...

>
> >7. The candidate must write a function which prints from 1 to
> > 100 and back to 1 without making use of for, while, goto,
> > or any looping constructs what-so-ever.


>

> ask them if they have ever heard of recursion, and if so, to
> write a code snippet that demonstrates it. Ask them why they would use
> recursion instead of iteration. It's also nice to find out if the candidate
> has ever used the concept in any project they've worked on.
>


Even here, I perceived this as a psychological test:
"Is the applicant ready to do a tedious work, fast and
dirty way, when he have no good idea how to do it nice
and efficiently, but the job is to be done yesterday?"


Would I get this question at interview, with 100%
probability the answer will be:

printf( "1 2 3 4 5 6 7 8 9 10\n" );
printf( "11 12 13 14 15 16 17 18 19 20\n" );

etc.

or equivalent using the C++ streams.

With the range 1 to 10000 it would be another story.
Never mind the 10000 level deep stack :=(

BTW, during more or less casual conversation (not a
formal examination), I would consider the wording
"without making use of ... any looping constructs
what-so-ever" as banning the recursion too.

Francis Glassborow

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to
In article <8b1ln0$sd8$1...@nnrp1.deja.com>, Dietmar Kuehl
<dietma...@claas-solutions.de> writes

> std::generate_n(std::ostream_iterator<int>(std::cout, "\n"),
> count, up);
> std::generate_n(std::ostream_iterator<int>(std::cout, "\n"),
> count, down);

But don't these include hidden loops?


Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Andy Glew

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to
> Here is a non-recursive version which does not use any looping
> construct:

I prefer the recursive solution. Oy, vey!

By the way, how do you define the semantics
of generate_n without looping constructs?
The loops are there, in your mind and in the
abstract definition of generate_n. You've
just obscured them.

> #include <algorithm>
> #include <vector>
> #include <iterator>
> #include <iostream>
>
> static int const count = 100;
>
> int up() {
> static int rc = 1;
> return rc++;
> }
>
> int down() {
> static int rc = count;
> return rc--;
> }
>
> int main() {

> std::generate_n(std::ostream_iterator<int>(std::cout, "\n"),
> count, up);
> std::generate_n(std::ostream_iterator<int>(std::cout, "\n"),
> count, down);
> }

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Courageous

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to

> I can't remember the last time that I've seen requirements which specified
> you can't use a for loop. Your example is totally removed from the real
> world. If you are hiring people to take tests, then you have a good way to
> weed out people. If you are hiring people to do a job, then you should
> still be looking for a better way.

I've long debated the merits of this particular question; I often
skip it. One part of the test is observing them use the editor, the
compiler, and how they go about debugging these simple problems.
That's fairly real world.

> Or a code review.

That's not a bad idea. One alternative would be to cut a few of
the questions out, and concentrate on the more dynamic question
asking after demonstrating mastery with a few simple language
elements (value versus reference, pointers, virtual functions).

There's nothing to say that the specific code questions that I
ask have to be many.

Which questions would you ask if you wanted to be sure that an
interviewee really did understand fundamental concepts that they
ought to have learned in school?

C/

John Clonts

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to
Andy Glew wrote:
>
> > Here is a non-recursive version which does not use any looping
> > construct:
>
> I prefer the recursive solution. Oy, vey!
>
> By the way, how do you define the semantics
> of generate_n without looping constructs?
> The loops are there, in your mind and in the
> abstract definition of generate_n. You've
> just obscured them.

Well for that matter isnt recursion a "looping construct"?

AHA! heres the answer, go meta on `em:

cout << "#include <iostream>\nusing std::cout;\n"
<< "int main() {\n";
cout << "cout << \"" ;
for (int i=1; i<=100;i++) cout << " " << i;
for (int i=99; i>0; i--) cout << " " << i;
cout << "}";

and answer is the (resultof (resultof programrun)).

Cheers,
John

Courageous

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to

> Here is a non-recursive version which does not use any looping
> construct:

Well, with programmers like you, I laugh, skip the question,
ask you a bit about recursion, and move on.

BTW, I didn't say, but the test is really just some programming
problems (very simple ones) with a compiler handy. Depending
on certain verbal answers, I sometimes judiciously skip
problems.

The test is really only a mastery of the fundamentals test.
When I started giving it, just to see how people would do,
it frightened me how poorly some people did (passing the
pointer by address in question 3 (or promoting it to a
reference... C versus C++ method)) is one which over 50%
of our candidates outright can't do. I have to know.


C/

Dietmar Kuehl

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to
Hi,

I'm following up to my own article because I have just seen three
statements in this thread which have not yet appeared at my newsserver
(I just approved them and propagation delay will be several hours
before I see them).

Basically, there were two statements saying that 'generate_n()'
actually includes a loop and one statement that the question is messed
up and unrealistic. I have to comment on both.

The first thing is that I think the question for some code producing
100 numbers without a loop is basically the question "Have you used
STL?" Asked in the second form you would probably claim that sure, you
have! Actually, I doubt that you realy have used STL otherwise this
approach would have been apparent to you immediately: Even if the
question was intended to test your knowledge about recursion you would
prove with an STL approach that you have significant insight into C++.
I think this is an excellent question if you want to know whether the
person asked has advanced C++ knowledge. If he/she answers with a
recursive version it would be possible to rule that out, too, and test
whether the STL solution pops up. ... and if you really want to know
whether the person knows how to use recursion but answered with an STL
approach, well, do it the other way around: Rule out the use of the
standard library.

The second thing is that I don't know why you think that 'generate_n()'
actually uses a loop! I never thought about 'generate_n()' being a
different spelling of a loop. It is a certain operation. Now that you
pretend that it actually is a loop, I can't see how you got this idea.
Here is an implementation of 'generate_n()':

template <typename OutIt, typename Size, typename Generator>
void
generate_n(OutIt out, Size count, Generator generator)
{
if (count > 0)
{
*out = generator();
generate_n(++out, --count, generator);
}
}

... and this is clearly not the only possible implementation. In
particular, the compiler is free to generate *rather* different code
than this one, especially if it detects that the 'count' is actually
a constant expression. For example, the compiler can do something like
this (I used a different signature for 'generate_n()' to produce a
version which can actually be compiled and tested; the compiler could
use basically the same approach but preserve the original signature):

template <int sz, typename OutIt, typename Gen>
struct generate_n_aux
{
void operator()(OutIt& out, Gen gen) const
{
generate_n_aux<sz / 2, OutIt, Gen>()(out, gen);
generate_n_aux<sz - sz / 2, OutIt, Gen>()(out, gen);
}
};

template <typename OutIt, typename Gen>
struct generate_n_aux<0, OutIt, Gen>
{
void operator()(OutIt&, Gen) const
{
}
};

template <typename OutIt, typename Gen>
struct generate_n_aux<1, OutIt, Gen>
{
void operator()(OutIt& out, Gen gen) const
{
*out = gen();
++out;
}
};

template <int count, typename OutIt, typename Generator>
void
generate_n(OutIt out, Generator generator)
{
generate_n_aux<count, OutIt, Generator>()(out, generator);
}

To test this version you can call it like this:

generate_n(std::ostream_iterator<int>(std::cout, "\n"), count, up);

Basically what is going on is just that the recursion is handled at
compile time, ie. the 'count' modification is done during compilation
rather than at run time. That is, if there is a really clever compiler,
you might be able to move operations to compile time. Probably, it will
take a long time before such compilers come into existance... A more
likely event it is that the language provides some way to determine
whether a certain argument is a constant expression and some way to
make use of this knowledge. In this case library implementors could
provide specialized versions of functions where this is likely to be
an advantage. Whether this would be the case for 'generate_n()' is
beyond me. What I know, however, is that a lot of work is invested in
handling of special cases to improve the performance at least in the
standard C++ library.


Sent via Deja.com http://www.deja.com/
Before you buy.

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Nick Thurn

unread,
Mar 20, 2000, 3:00:00 AM3/20/00
to

Courageous wrote in message <38D1E33A...@san.rr.com>...
>
>I give a very simple test, which most of our candidates of late
>(these are people with CS degrees from major institutions) have
>been failing. The questions are extraordinarily simple.
>
>7. The candidate must write a function which prints from 1 to
> 100 and back to 1 without making use of for, while, goto,
> or any looping constructs what-so-ever.
>
For recursion a binary tree traversal might be a better choice,
mainly because the restrictions placed on the programmer
in your question don't make sense in a real program.

The rest of your test seems pretty good.

BTW one question from my old company's test that
virtually no one ever got right (or even close) was:

Given:
struct Item { int number; Item* next; };

write the function below :
void deleteMatchingItems(Item** list, int number_to_match);

Perhaps it is too C'ish for a C++ test but the code should not
be beyond a competent C++ programmer (IMO anyway).

cheers
Nick

Andy Glew

unread,
Mar 20, 2000, 3:00:00 AM3/20/00
to
> Well for that matter isn't recursion a "looping construct"?

No.

Looping is a simple (tail) recursion.
Any loop can be implemented in terms
of a recursion.

Recursion, in general, requires a loop
and a stack to implement.

Recursion is more general.
Looping is a primitive that can be used
to implement recursion, but is not sufficient
to implement recursion.

Almost everything is equivalent on the Turing level.
At the level at which we can compare them
meaningfully, recursion is more powerful.

Francis Glassborow

unread,
Mar 20, 2000, 3:00:00 AM3/20/00
to
In article <38D51B90...@san.rr.com>, Courageous
<jkra...@san.rr.com> writes

>> Here is a non-recursive version which does not use any looping
>> construct:
>
>Well, with programmers like you, I laugh, skip the question,
>ask you a bit about recursion, and move on.

I think others may be interested in his own solutions. The first he
posted to me was:

void f (int i)
{
printf("%d\n");
f(i+1);
pritnf("%d\n");
}

main()
{
f(1);
}

This will nearly do it. Yeah, I want them to know recursive functions.

And when I responded that this only tackled about 1% of the problem, he
offered this


#include <stdio.h>

void f (int i)
{
printf("%d\n", i);
if (i<100) f(i+1);
if (i<100) printf("%d\n", i);
}

main()
{
f(1);
}

Now that solution says a lot, note that it is entirely C even down to
the implicit int return from main(), it uses magic numbers (100) and
will blow the stack on many machines if you call f with f(-65535)

If it were an off the cuff answer by a candidate for employment it would
tell me quite a bit, as a considered answer (without time pressure or
the stress of being interviewed) from the interviewer it tells me some
other things.

To my mind this is exactly the kind of question that many of us
legitimately resent.

Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Francis Glassborow

unread,
Mar 20, 2000, 3:00:00 AM3/20/00
to
In article <8b4lce$2...@spool.cs.wisc.edu>, Andy Glew <gl...@cs.wisc.edu>
writes

>Almost everything is equivalent on the Turing level.
>At the level at which we can compare them
>meaningfully, recursion is more powerful.

But also has a serious problem with the way it consumes 'stack space'. I
think that the OP's question fits better in a Christmas quiz than in a
serious job interview. I would be profoundly uninterested in dirty, off
the cuff solution. I would be much more impressed by a candidate who had
the courage to tell me the question was stupid because only bad
programmers use recursion without real cause.

Francis Glassborow

unread,
Mar 20, 2000, 3:00:00 AM3/20/00
to
In article <8b3681$ro0$1...@nnrp1.deja.com>, Dietmar Kuehl
<dietma...@claas-solutions.de> writes

>Here is an implementation of 'generate_n()':
>
> template <typename OutIt, typename Size, typename Generator>
> void
> generate_n(OutIt out, Size count, Generator generator)
> {
> if (count > 0)
> {
> *out = generator();
> generate_n(++out, --count, generator);
> }
> }
When is a loop not a loop? The above is tail recursive and so isomorphic
with an iteration. Of course that comment effectively wipes out all
solutions other than that of literal output statements.

Such an implementation of generate_n would worry me as it has
implications on code size, compile time and stack integrity.

Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]

Sivier, Steve

unread,
Mar 20, 2000, 3:00:00 AM3/20/00
to
In article <38D51CAA...@san.rr.com>, Courageous
<jkra...@san.rr.com> wrote:

> > I can't remember the last time that I've seen requirements which specified
> > you can't use a for loop. Your example is totally removed from the real
> > world. If you are hiring people to take tests, then you have a good way to
> > weed out people. If you are hiring people to do a job, then you should
> > still be looking for a better way.
>
> I've long debated the merits of this particular question; I often
> skip it. One part of the test is observing them use the editor, the
> compiler, and how they go about debugging these simple problems.
> That's fairly real world.
>
> > Or a code review.
>
> That's not a bad idea. One alternative would be to cut a few of
> the questions out, and concentrate on the more dynamic question
> asking after demonstrating mastery with a few simple language
> elements (value versus reference, pointers, virtual functions).
>
> There's nothing to say that the specific code questions that I
> ask have to be many.
>
> Which questions would you ask if you wanted to be sure that an
> interviewee really did understand fundamental concepts that they
> ought to have learned in school?

Personally, I don't mind the tests - I think they're not bad for weeding
out the chaff. I just wish that the companies that use them would actually
use them. I tend to pass the tests (provided they're oriented more towards
C than C++ - I'm much more fluent in C than C++), but then I'm told that
they're not sure I can really work as a software engineer because even
though I worked (quite successfully) as a software engineer for a few
years, I'm now working as a mechanical engineer and so must not know how
to program. Very frustrating. Oh well, such is life.

Steve

Chris Uzdavinis

unread,
Mar 21, 2000, 3:00:00 AM3/21/00