I have to interview a C++ programmer tomorrow. What are a couple ofyour favorite questions I can use

  • Thread starter jaialai technology
  • Start date
J

jaialai technology

I have to interview a C++ programmer tomorrow.
What are a couple of your favorite questions I can use? :)
This is for a beginner. Sadly, the job is in India and I will be
interviewing this guy
over the phone from the US. So, no "write me some code that does X"
type questions
which are my favorites.
For a beginner I would have them start out with some simple looping,
pointers,
class definitions, etc etc just to see they have a foundation. Plus
other stuff too, of course
but this is out of the question given that this is all over the phone.
Plus, in my experience these guys are prone to...having a friend help,
but that is
a different story for another time.
All I have for now is stuff like "what are the different kinds of
inheritance? What is a virtual function?
Why would you use a friend function?" Just trivia type questions
really.
Anyway, any advice? Obviously, I haven't given a ton of interviews in
my time so I would
appreciate some advice.
Thanks!
 
V

Victor Bazarov

jaialai said:
I have to interview a C++ programmer tomorrow.
What are a couple of your favorite questions I can use? :)

Just use some of the FAQs.

V
 
D

dragan

jaialai said:
I have to interview a C++ programmer tomorrow.
What are a couple of your favorite questions I can use? :)
This is for a beginner. Sadly, the job is in India and I will be
interviewing this guy
over the phone from the US. So, no "write me some code that does X"
type questions
which are my favorites.
For a beginner I would have them start out with some simple looping,
pointers,
class definitions, etc etc just to see they have a foundation. Plus
other stuff too, of course
but this is out of the question given that this is all over the phone.
Plus, in my experience these guys are prone to...having a friend help,
but that is
a different story for another time.
All I have for now is stuff like "what are the different kinds of
inheritance? What is a virtual function?
Why would you use a friend function?" Just trivia type questions
really.
Anyway, any advice? Obviously, I haven't given a ton of interviews in
my time so I would
appreciate some advice.
Thanks!

You are a troll and you know that "entry-level C++" programmer is an
oxymoron. There is no place for "entry-level" when the language is obsolete!
 
B

Balog Pal

jaialai technology said:
I have to interview a C++ programmer tomorrow.
What are a couple of your favorite questions I can use? :)
This is for a beginner. Sadly, the job is in India and I will be
interviewing this guy
over the phone from the US.

Interesting. May I ask, what is the point?
I could imagine reasons to fetch a remote guy -- and accept the problems of
indirect communication worsened with time zones, if he's a rare top expert I
need much, and possibly costs fragment of locals too.

But a beginner? I look for beginners with open mind, and without being
spolied, so I can train them properly. That obvioisly needs being very
close.

If the aim is to extend the remote team, so similar mentoring is done there,
why not just leave the selection to them?

As for the questions, Victor's advice to go by the FAQ makes sense -- but it
is a safe bet that a beginner will not know almost anything. Correctly and
firmly enough.
Plus, in my experience these guys are prone to...having a friend help,
but that is
a different story for another time.
BAH.

All I have for now is stuff like "what are the different kinds of
inheritance? What is a virtual function?
Why would you use a friend function?" Just trivia type questions
really.
Anyway, any advice? Obviously, I haven't given a ton of interviews in
my time so I would
appreciate some advice.

Proper advice would require knowing the goals.

Hoenstly I have some experience with using help from India -- in a way that
sound like works at least on paper too, but the reality was sour. Without
exceptions.
but I guess you're not here fo advices like stay away or run like hell. ;-)
 
B

Bill Davy

jaialai technology said:
I have to interview a C++ programmer tomorrow.
What are a couple of your favorite questions I can use? :)
This is for a beginner. Sadly, the job is in India and I will be
interviewing this guy
over the phone from the US. So, no "write me some code that does X"
type questions
which are my favorites.
For a beginner I would have them start out with some simple looping,
pointers,
class definitions, etc etc just to see they have a foundation. Plus
other stuff too, of course
but this is out of the question given that this is all over the phone.
Plus, in my experience these guys are prone to...having a friend help,
but that is
a different story for another time.
All I have for now is stuff like "what are the different kinds of
inheritance? What is a virtual function?
Why would you use a friend function?" Just trivia type questions
really.
Anyway, any advice? Obviously, I haven't given a ton of interviews in
my time so I would
appreciate some advice.
Thanks!


Also a bit of Turing test. Are you sure the person(s) you interview is the
one who will be writing code for you?



Not many people appreciate the significance of declaring a member variable
"mutable".



I also find one of the biggest inefficiencies of programmers is lack of
knowledge of what has been done already (e.g. STL, Boost, etc) and how to
find out (e.g. Google, FAQ, and newsgroups).
 
M

Michael Tsang

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You are a troll and you know that "entry-level C++" programmer is an
oxymoron. There is no place for "entry-level" when the language is
obsolete!

Which language is obsolete?!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAksU9IAACgkQG6NzcAXitM/hFwCdHDcTaBrk8P5hJtdqIsNrNbyo
vXAAn1Qe5yCkDVwuZLYZUeGTufsnVc28
=s4ZP
-----END PGP SIGNATURE-----
 
J

jaialai technology

Hoenstly I have some experience with using help from India -- in a way
that sound like works at least on paper too, but the reality was sour.
Without exceptions.
but I guess you're not here fo advices like stay away or run like hell. ;-)
Yeah, if the job market were better I would look to
switch jobs both in protest
and in anticipation of the ongoing nightmare this is
going to be.
This guy I interviewed today was actually pretty
good though! Who knows if this is the same guy
that will be actually working for us though.
These offshore companies are the biggest
bullshitters and scammers out there. I am surprised
that this fact does not receive wider publicity.
I'd sooner trust an email from a "nigerian finance
minister" than one from Wipro or Patni.
Anyway, I asked him some stuff about virtual
functions and inheritance and then, since it was
on his resume I asked him about multi-threaded
programming. He answered it all just fine.
It would be funny though if he were just the guy
that the company brings out to interview for C++
jobs. The dedicated interviewer
 
D

dasjotre

I have to interview a C++ programmer tomorrow.
What are a couple of your favorite questions I can use? :)

my favourite interview question is "how much would you like to be
paid?". sadly it never comes up ;)
 
V

Victor Bazarov

dasjotre said:
my favourite interview question is "how much would you like to be
paid?". sadly it never comes up ;)

Strange. About 50% of my interviews did have it, but usually coming
from the HR person, not the technical interviewer. It's not necessarily
phrased that way, but you'd recognise it, I'm sure of it.

V
 
J

James Kanze

Strange. About 50% of my interviews did have it, but usually
coming from the HR person, not the technical interviewer.
It's not necessarily phrased that way, but you'd recognise it,
I'm sure of it.

It doesn't come up in interviews, because you don't go to an
interview before it's been asked. Why waste your time and that
of the company unless you're on the same wave length?
 
V

Victor Bazarov

James said:
It doesn't come up in interviews, because you don't go to an
interview before it's been asked. Why waste your time and that
of the company unless you're on the same wave length?

James, I am not sure to whom you are replying here. When the payment
question didn't come up in my interviews, it was either a non-negotiable
thing (like a predetermined amount from the paygrade, for example, in a
government-run facility), or was dependent largely on my performance,
like in a case of "pay accord" (larger pay if finished before the given
deadline).

Not sure what wave length you mean.

V
 
S

Stefan Ram

jaialai technology said:
Anyway, any advice? Obviously, I haven't given a ton of interviews in
my time so I would

Given

void f( int const a, int const b )
{ ... int const r = a + b; ... }

, how do you know whether the evaluation of »+«
overflows or underflows? What is the value of

-1 < 3000000000

? (The correct answer two the second question is:
»The value is implementation specified«.)
 
R

Richard

[Please do not mail me a copy of your followup]

jaialai technology <[email protected]> spake the secret code
I have to interview a C++ programmer tomorrow.
What are a couple of your favorite questions I can use? :)

Walk them over to your developer area and pair program with them for
an hour or two. Have the applicant "drive" while you "navigate". If
they are a good programmer, it will become obvious after about 20
minutes. If they can "talk the talk" but can't "walk the walk" that
will also become obvious after about 20 minutes. It also identifies
people who program well but interview poorly and people who interview
well but program poorly. After about half an hour of doing real code
in front of someone, its difficult to keep up an "act" in hopes of
getting the job. The rest of the time in the hour or two you spend
getting to know them a little bit and find out if they are someone you
could actually stand to have on your team (personality wise).
 
D

Default User

Richard said:
jaialai technology <[email protected]> spake the secret
code


Walk them over to your developer area and pair program with them for
an hour or two.

I guess you missed this:

"Sadly, the job is in India and I will be interviewing this guy over
the phone from the US. So, no "write me some code that does X" type
questions which are my favorites."




Brian
 
R

Richard

[Please do not mail me a copy of your followup]

"Default User" <[email protected]> spake the secret code
I guess you missed this:

"Sadly, the job is in India and I will be interviewing this guy over
the phone from the US. So, no "write me some code that does X" type
questions which are my favorites."

So use gotomeeting.com and skype and pair program remotely. They're
coding, you're navigating. You just have to watch how they are using
the computer on the screen.
 
J

James Kanze

James, I am not sure to whom you are replying here.

Both you and the person you responded to, partially. He said the
question doesn't come up---you said it comes up 50% of the time.
I say that it doesn't come up that often because you've more or
less discussed it before the actual interview, at least enough
to know that the position will pay enough for you to be
interested in it.
When the payment question didn't come up in my interviews, it
was either a non-negotiable thing (like a predetermined amount
from the paygrade, for example, in a government-run facility),
or was dependent largely on my performance, like in a case of
"pay accord" (larger pay if finished before the given
deadline).

I don't think I've ever discussed pay in the actual interview.
Discussing it is certainly part of the total process, however.
Before even scheduling the interview, I'll find out enough about
the position (including pay) to know whether it could possibly
interest me---there's no point in my going to an interview when
what they're looking for (and ready to pay for) is a starting
engineer fresh out of college. And unless it's something
non-negotiable, like you describe, it will be discussed after
the interview, if the interview was successful, but by that
time, we're normally close enough that it's just a question of
working out the details.
Not sure what wave length you mean.

It's an English (American English?) expression: to be on the
same wave length means that you're more or less talking about
the same thing. If I go into an interview expecting a senior
position, and they're looking for a starting engineer, we
weren't on the same wave length.
 
J

James Kanze

void f( int const a, int const b )
{ ... int const r = a + b; ... }
, how do you know whether the evaluation of »+«
overflows or underflows?

That's really more or less a trick question. The "correct"
answer, of course, is that you can't---overflow in an arithmetic
operation is undefined behavior. But the only people likely to
know that are experts with the standard (which isn't necessarily
the most important criteria for anything---unless maybe you're
developing a compiler). Good programmer check before hand, so
that overflow isn't possible.

(Given the above sample, I'd ask: "why the const?" There's no
"correct" answer, of course, but it would be interesting to see
what the candidate thinks about it, and why.)
What is the value of
-1 < 3000000000
? (The correct answer two the second question is:
»The value is implementation specified«.)

As you say, it is implementation defined: it is either true, or
a compiler error. But many compilers have historically gotten
it wrong (not generating an error for 3000000000, even if it
isn't representable in a signed integral type), and both C and
the next version of C++ it will be required to be true (since C
and the next version of C++ will require long long).

But again, it's a trick question, since good programmers don't
put themselves in a position where it might matter.
 
J

James Kanze

jaialai technology <[email protected]> spake the
secret code
<4b16e8af-d0db-4e20-bb50-d4670c4d9...@m25g2000yqc.googlegroups.com>
thusly:
Walk them over to your developer area and pair program with
them for an hour or two.

Pair program what? Having the candidate walk through the
development of something with you is obviously a good idea, but
it has to be something small enough and concrete enough for them
to reasonably be able to make some progress in the alloted time.
Which leads back to the original question: what question to ask.
Have the applicant "drive" while you "navigate". If they are
a good programmer, it will become obvious after about 20
minutes. If they can "talk the talk" but can't "walk the
walk" that will also become obvious after about 20 minutes.
It also identifies people who program well but interview
poorly and people who interview well but program poorly.

You could also set the interview up as a code review session.
But I'm a little sceptical of forcing any actual form down the
candidates throat. Some people (myself included) don't function
well with someone looking over their shoulder at every instant,
and others will have no real experience in successful code
review, even though they have the necessary underlying
knowledge, and could learn it quickly (but not in twenty
minutes).
After about half an hour of doing real code in front of
someone, its difficult to keep up an "act" in hopes of getting
the job. The rest of the time in the hour or two you spend
getting to know them a little bit and find out if they are
someone you could actually stand to have on your team
(personality wise).

In some ways, you could put the "acting" into this: the fact
that a person "acts" rather than really performs is part of his
personality. In practice, though, I've found a few simple
questions sufficient to weed out the bluffers. At least in my
experience, people who know how to write CV's which are mostly
fiction don't know anything about programming, and even simple
questions like "why would you declare a destructor virtual?"
will leave them struggling---or answering who knows what
nonsense. And once you know that the CV isn't bluff, if it
fits, what's left is the personality issues.
 
B

Balog Pal

"James Kanze"
a compiler error. But many compilers have historically gotten
it wrong (not generating an error for 3000000000, even if it
isn't representable in a signed integral type), and both C and
the next version of C++ it will be required to be true (since C
and the next version of C++ will require long long).

Hm, this made me curious for what
-1 < 60000
would mean wher int and long is 16 bits... Would that make 60000 unsigned?

The '98 standard, 2.13.1p2:
"The type of an integer literal depends on its form, value, and suffix. If
it is decimal and has no suffix, it has the first of these types in which
its value can be represented: int, long int; if the value cannot be
represented as a long int, the behavior is undefined."

Looks it is UB, and the compilers you mentioned didn't get it wrong
standard-wise, only QoI-wise.

Honestly I see little excuse from making it ill-formed. (Guess there is a
ton of code around that use such literals without u suffix to init an
unsigned type, and they left a chance to keep it work...)


Stefan, how would you react if the guy at the interview pointed out your
answer is wrong?
 
B

Balog Pal

James Kanze said:
Pair program what? Having the candidate walk through the
development of something with you is obviously a good idea, but
it has to be something small enough and concrete enough for them
to reasonably be able to make some progress in the alloted time.
Which leads back to the original question: what question to ask.

You could also set the interview up as a code review session.

LOL, wanted to say the same. It may be a good idea to snapshot some
interesting cases from production for this purpose too.

I had the idea for long but never used it in practice -- I had a good
picture of the candidate by other means. Though if I had people who scored
20/20 on the entry test and looked pro I'm sure it would be a good way.
But I'm a little sceptical of forcing any actual form down the
candidates throat. Some people (myself included) don't function
well with someone looking over their shoulder at every instant,
and others will have no real experience in successful code
review, even though they have the necessary underlying
knowledge, and could learn it quickly (but not in twenty
minutes).

I don't get this -- what looking over the shoulder? The guy would do the
review, and I play the part of defender.
 

Ask a Question

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

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top