| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| if i want cin 12345678910 and cout abcdefghij.
so how can i create the program?.
example : if i key in 8910 so the answer is ghij. | | 3 |
| Evaluate:
int fn(int v)
{
if(v==1 || v==0)
return 1;
if(v%2==0)
return fn(v/2)+2;
else
return fn(v-1)+3;
}
for fn(7);
a) 10
b) 11
c) 1
| Quark | 1 |
| why we cant create array of refrences | | 2 |
| What is a mutex and a critical section.Whats difference
between them?How do each of them work? | CTS | 1 |
| When the design recommends static functions? | Symphony | 1 |
| What is the Difference between "C structure" and "C++
structure"? | | 4 |
| What is conversion constructor? | TCS | 1 |
| What are the advantages and disadvantages of using inline
and const? | TCS | 1 |
| Can you explain the term "resource acquisition is
initialization?" | | 1 |
| class basex
{
int x;
public:
void setx(int y) {x=y;}
};
class derived : basex {};
What is the access level for the member function "setx" in
the class "derived" above?
a) private
b) local
c) global
d) public
e) protected
| Quark | 1 |
| What are the different types of polymorphism? | | 2 |
| What are the different types of Storage classes? | | 3 |
| class HasStatic {
static int I;
};
Referring to the sample code above, what is the appropriate
method of defining the member variable "I", and assigning it
the value 10, outside of the class declaration?
a) HasStatic I = 10;
b) int static I = 10;
c) static I(10);
d) static I = 10;
e) int HasStatic::I = 10;
| Quark | 1 |
| Difference between static global and global? | Symphony | 8 |
| What are advantages of C++ when comparing with C? | HP | 3 |
| Consider a c++ template funtion
template<class T>
T& Add(T a, T b){return a+b ;}
if this function is called as
T c = Add("SAM", "SUNG");
what will happen? What is the problem in the template
declaration/ How to solve the problem. | Samsung | 4 |
| "How will you merge these two arrays? Write the program
Array: A 1 18 22 43
Array: B 3 4 6 20 34 46 55
Output Array: C 1 3 4 6 18 20 22 34 43 46 55"
| HCL | 5 |
| What are advantages and disadvantages of Design patterns? | IBM | 3 |
| How can you find the nodes with repetetive data in a linked
list? | Lucent | 1 |
| How Virtual functions call up is maintained? | | 2 |
| |
| For more C++ General Interview Questions Click Here |