Interview questions in C++ and OO

S

shabbir

Hello All

I am recently going for an interview in C++ and would like to know
where can i find some of the tricky questions in C++. I am through with
all that available on parashift and is looking for some more questions
on the topic.

Thanks
Shabbir Bhimani
 
B

BigBrian

Hello All
I am recently going for an interview in C++ and would like to know
where can i find some of the tricky questions in C++. I am through with
all that available on parashift and is looking for some more questions
on the topic.

Thanks
Shabbir Bhimani


I'd recommend reading (first) "The C++ programming language" by
Stroustrup and actually learning the language, instead of just
memorizing answers to "some of the tricky questions in C++". Once you
know the language, those questions may not seem so tricky anymore.
 
S

shabbir

I have already learnt the language and have cleared 2 levels of
interview and as I have time would like to learn more and become more
confident.

Thanks
Shabbir Bhimani
 
D

DHOLLINGSWORTH2

When or why would you need to use pure virtual functions.
When or why would you need to use friend.

Give examples of both.

Read Code Complete. IT's a good conversational piece.
 
C

Carl Muller

shabbir said:
Hello All

I am recently going for an interview in C++ and would like to know
where can i find some of the tricky questions in C++. I am through with
all that available on parashift and is looking for some more questions
on the topic.

Thanks
Shabbir Bhimani

"Language Lawyer" interview questions are often covered in the Herb
Sutter books (Exceptional C++ etc.) (see also www.gotw.ca/gotw) and
the Scott Meyers books.
They are a useful supplement to experience, but you need practice as
well as knowledge in order to be a good developer.
 
S

shabbir

When or why would you need to use pure virtual functions.
Pure virtual functions are needed when more than one derived classes
have the dissimilar functionality of the same behavior of the class.

Eg;-
Animal class <-- Base
Dog / Cat <-- Derived

Dog and cat both make a sound but the behavior of the function sound is
different and so it can be pure virtual function in Animal class.

When or why would you need to use friend.
Friend functions are best used when we need a bridge between more than
one class.

Thanks
Shabbir Bhimani
 

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

Forum statistics

Threads
474,202
Messages
2,571,055
Members
47,659
Latest member
salragu

Latest Threads

Top