A
arnuld
After1 month from now, I will start giving job interviews. Searchign at
Google led me to several common questions asked in interviewers looking
for C++ based programmers. I have titled it "C++ interview questions - 1
(technical)" as, after sometime, I will start another thread titled "C++
interview questions (general)":
I searched for the archives too but didn ot get answers:
1.) Why array index start at 0 (zero) ?
I got these results but I can't know which one is right:
http://groups.google.com/group/comp.lang.c/browse_thread/
thread/73497fc628da3bf5/69c1e93404e86b5c?q=why+array+index+start+at+zero&lnk=ol&
http://groups.google.com/group/comp.lang.c/browse_thread/thread/6aadd2ee93c4283e
/675769f6aa2315ce?lnk=gst&q=why+array+index+start+at+zero#675769f6aa2315ce
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/3323640c835dd407/
e0972682186dcdd9?lnk=gst&q=why+array+index+start+at+zero#e0972682186dcdd9
2.) What is RTTI and What is the difference between dynamic_cast and
static_cast ?
RTTI means "Run-Time Type Information" and I have no idea about its
definition
.
dynamic_cast can cast from a base class to a derived class but static_cast
can not do that . Right ?
3.) How is static variable stored in the memory ?
I got these and they say "It is not defined in the C++ & C Standard":
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/ef9acfeaa4862e4/
8a7afbe1993f2be8?lnk=gst&q=how+static+variable+is+stored+in+memory#8a7afbe1993f2be8
http://groups.google.com/group/comp.lang.c/browse_thread/thread/7812891d697d6897/
fc02e5c49baf0a44?lnk=gst&q=how+static+variable+is+stored+in+memory#fc02e5c49baf0a44
http://groups.google.com/group/comp.lang.c/browse_thread/thread/e5231a596c44a23c/
772e42e38db4f5f7?lnk=gst&q=how+static+variable+is+stored+in+memory#772e42e38db4f5f7
4.) what is an escaping variable?
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/18070ad1b1f3e13d/
ddda06e0ed32782b?lnk=gst&q=what+is+escaping+variable#ddda06e0ed32782b
I think in both questions (3rd and 4th ) "Victor Bazarov" is right but
what should I answer in front of an HR ?
5.) How can you force instantiation of a Template ?
6.) What is a Framework in C++ ?
7.) What happens to the member functions in the class when copy
constructor is invoked ?
8.) What are the different types of storage classes ?
9.) What is the difference between function-overloading and
operator-overloading ?
10.) Is there any way to write a class so that no class can be
iinherited from it ?
11.) What is the difference between a user-defined object and standard
object ?
12.) How to create an object so that it should not call its constructor
by default ?
13.) Is it possible to inherit the private members in derived class ?
14.) what is the difference between static global variable and static
local variable ?
(I always thought that there is nothing like "static global variable")
15.) What are the types of STL containers ?
(I think that they are typeless)
16.) What are Polymorphic Classes ?
(Classes which are related by polymorphism. It means, they have similar
operations and are derived from some other classes which , in fact, have
inherited the same base class)
17.) What do you mean by binding of data and functions ?
18.) What is the difference between macro and inline() ?
(A macro bypasses the preprocesses whereas inline() does not)
19.) What is a memory leak ? How we can avoid it ?
20.) what is the difference between wait() and delay() ?
21.) What is the difference a fake pointer and a smart pointer ?
(ouch!, I did not even know that there is a thing called "fake pointer" )
Here are some funny interviews questions:
- What is the difference a Function and a Member-Function ?
- What is the virtual class and friend class ?
- What is the difference C and C++ ?
- What is namespace ?
Google led me to several common questions asked in interviewers looking
for C++ based programmers. I have titled it "C++ interview questions - 1
(technical)" as, after sometime, I will start another thread titled "C++
interview questions (general)":
I searched for the archives too but didn ot get answers:
1.) Why array index start at 0 (zero) ?
I got these results but I can't know which one is right:
http://groups.google.com/group/comp.lang.c/browse_thread/
thread/73497fc628da3bf5/69c1e93404e86b5c?q=why+array+index+start+at+zero&lnk=ol&
http://groups.google.com/group/comp.lang.c/browse_thread/thread/6aadd2ee93c4283e
/675769f6aa2315ce?lnk=gst&q=why+array+index+start+at+zero#675769f6aa2315ce
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/3323640c835dd407/
e0972682186dcdd9?lnk=gst&q=why+array+index+start+at+zero#e0972682186dcdd9
2.) What is RTTI and What is the difference between dynamic_cast and
static_cast ?
RTTI means "Run-Time Type Information" and I have no idea about its
definition
dynamic_cast can cast from a base class to a derived class but static_cast
can not do that . Right ?
3.) How is static variable stored in the memory ?
I got these and they say "It is not defined in the C++ & C Standard":
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/ef9acfeaa4862e4/
8a7afbe1993f2be8?lnk=gst&q=how+static+variable+is+stored+in+memory#8a7afbe1993f2be8
http://groups.google.com/group/comp.lang.c/browse_thread/thread/7812891d697d6897/
fc02e5c49baf0a44?lnk=gst&q=how+static+variable+is+stored+in+memory#fc02e5c49baf0a44
http://groups.google.com/group/comp.lang.c/browse_thread/thread/e5231a596c44a23c/
772e42e38db4f5f7?lnk=gst&q=how+static+variable+is+stored+in+memory#772e42e38db4f5f7
4.) what is an escaping variable?
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/18070ad1b1f3e13d/
ddda06e0ed32782b?lnk=gst&q=what+is+escaping+variable#ddda06e0ed32782b
I think in both questions (3rd and 4th ) "Victor Bazarov" is right but
what should I answer in front of an HR ?
5.) How can you force instantiation of a Template ?
6.) What is a Framework in C++ ?
7.) What happens to the member functions in the class when copy
constructor is invoked ?
8.) What are the different types of storage classes ?
9.) What is the difference between function-overloading and
operator-overloading ?
10.) Is there any way to write a class so that no class can be
iinherited from it ?
11.) What is the difference between a user-defined object and standard
object ?
12.) How to create an object so that it should not call its constructor
by default ?
13.) Is it possible to inherit the private members in derived class ?
14.) what is the difference between static global variable and static
local variable ?
(I always thought that there is nothing like "static global variable")
15.) What are the types of STL containers ?
(I think that they are typeless)
16.) What are Polymorphic Classes ?
(Classes which are related by polymorphism. It means, they have similar
operations and are derived from some other classes which , in fact, have
inherited the same base class)
17.) What do you mean by binding of data and functions ?
18.) What is the difference between macro and inline() ?
(A macro bypasses the preprocesses whereas inline() does not)
19.) What is a memory leak ? How we can avoid it ?
20.) what is the difference between wait() and delay() ?
21.) What is the difference a fake pointer and a smart pointer ?
(ouch!, I did not even know that there is a thing called "fake pointer" )
Here are some funny interviews questions:
- What is the difference a Function and a Member-Function ?
- What is the virtual class and friend class ?
- What is the difference C and C++ ?
- What is namespace ?