C++ interview questions

J

James Kanze

But would answer the original question of "How can you force
instantiation of a Template?" :)

What does it mean to "force instantiation of a template"?

-- The compiler will instantiate a template implicitly, when
needed. I can "force" it to instantiate the template, even
if not otherwise needed, by requesting explicit
instantiation.

-- I can request explicit instantiation of a template. I can
force the compiler to instantiate it even in the absence of
such a request simply by using it in certain ways.

-- The compiler never instantiates a template without a reason:
I either have to explicitly request it, or use it in some
way which triggers instantiation. In other words, a
template is never instantiated unless the compiler is
"forced" to do so.

The question, as worded, is an example of sloppiness and
imprecision. Computer science, software engineering, and
programming in general are activities requiring a enormous
amount of order and precision. The only possible use of a
question like this would be as a trick question: any simple
response shows that you missed the ambiguity, and perhaps don't
possess enough order and precision to be competent in the field.
The problem with such trick questions, however, is that a simple
response might simply be that you're used to dealing with
management types who don't possess order and precision, and know
how to exterpolate what they probably mean from what they
actually said. In most cases, for example, I'm willing to bet
that the first answer above was the one the interviewer was
actually looking for.

Depending on the role the interviewer has in the organization,
such questions might make me wonder about whether I want to work
there or not. (If it's someone in DHR, it's more or less what
I'd expecct---if it's supposedly the technical lead, on the
other hand...)
 
L

LR

James said:
The question, as worded, is an example of sloppiness and
imprecision.

Aren't most questions? Isn't this one?

Computer science, software engineering, and
programming in general are activities requiring a enormous
amount of order and precision.

Which often isn't available.


The only possible use of a
question like this would be as a trick question: any simple
response shows that you missed the ambiguity, and perhaps don't
possess enough order and precision to be competent in the field.

There can be another reason for asking questions like this.

Let's call it Change. Following the rule that code that isn't
maintained isn't used, change becomes an important thing for programmers
to deal with.

So the question itself, and the answer might not be the important thing
here. It's the follow up that begins: What if....



The problem with such trick questions, however, is that a simple
response might simply be that you're used to dealing with
management types who don't possess order and precision, and know
how to exterpolate what they probably mean from what they
actually said.

There are two kinds of trick question. The obvious pernicious kind that
the interviewer asks to demonstrate their, what should be obvious to the
interviewee, intellectual superiority (What's the third word on page 732
of the standard? You don't know? Well, that's an important page.) And
the other kind which IMO is not pernicious, that's meant to find out how
the person being interviewed thinks and how they react to situations
that they may face in a work situation.

In most cases, for example, I'm willing to bet
that the first answer above was the one the interviewer was
actually looking for.

Probably, but there should probably be a follow up. Maybe from the
interviewee too.

Depending on the role the interviewer has in the organization,
such questions might make me wonder about whether I want to work
there or not. (If it's someone in DHR, it's more or less what
I'd expecct---if it's supposedly the technical lead, on the
other hand...)

I think it would be the other way around for me. If someone in HR asked
me that I'd wonder why the company was putting those kinds of questions
in the hands of someone who probably couldn't understand the answers or
even clarify the question.


How would you move Mt. Fuji?
How many gas (petrol) stations are there in your state (or province or
county)?
Design a house.

Or.

I want a program written that finds out how many gas stations there are
in Los Angeles. Tell me about the program you might write to do that.
What kinds of things do you not know how to do, and how might you go
about finding out how to do them?

LR
 
Joined
Aug 10, 2010
Messages
4
Reaction score
0
Hi,

Thanks very much for this comment. I was actually hired from another interview I had. I'm sure this thread will be useful for others though.

Apart from that, this link below may be useful: commoninterviewquestions.info/
Tks again and pls keep posting.


LR said:
James Kanze wrote:
Aren't most questions? Isn't this one?

Which often isn't available.


There can be another reason for asking questions like this.

Let's call it Change. Following the rule that code that isn't
maintained isn't used, change becomes an important thing for programmers
to deal with.

So the question itself, and the answer might not be the important thing
here. It's the follow up that begins: What if....

There are two kinds of trick question. The obvious pernicious kind that
the interviewer asks to demonstrate their, what should be obvious to the
interviewee, intellectual superiority (What's the third word on page 732
of the standard? You don't know? Well, that's an important page.) And
the other kind which IMO is not pernicious, that's meant to find out how
the person being interviewed thinks and how they react to situations
that they may face in a work situation.

Probably, but there should probably be a follow up. Maybe from the
interviewee too.
I think it would be the other way around for me. If someone in HR asked
me that I'd wonder why the company was putting those kinds of questions
in the hands of someone who probably couldn't understand the answers or
even clarify the question.


How would you move Mt. Fuji?
How many gas (petrol) stations are there in your state (or province or
county)?
Design a house.

Or.

I want a program written that finds out how many gas stations there are
in Los Angeles. Tell me about the program you might write to do that.
What kinds of things do you not know how to do, and how might you go
about finding out how to do them?

LR
 
Last edited:

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,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top