| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What about Virtual Destructor?
| Virtusa | 1 |
| what is the diff b/n c and c++
a. dynamic scoping
b. nested switching
c. declaration of variables in any code block
d. separation of compilation and linking
| Hughes | 1 |
| What are the advantages and disadvantages of using inline
and const? | TCS | 1 |
| Explain the ISA and HASA class relationships. How would you
implement each in a class design? | | 2 |
| What is "map" in STL? | | 1 |
| Describe functional overloading? | HP | 3 |
| Can inline functions have a recursion? Give the reason? | | 1 |
| Implement strcmp | Citadel | 2 |
| What are Virtual Functions? How to implement virtual
functions in "C" ? | | 2 |
| Explain working of printf? | | 3 |
| When volatile can be used? | Symphony | 2 |
| Is there any difference between dlearations int* x and int
*x? If so tell me the difference? | Lason | 13 |
| 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 |
| Write a function which takes a character array as input and
reverses it in place. | Lehman-Brothers | 2 |
| What is the Maximum Size that an Array can hold? | Satyam | 31 |
| catch(exception &e)
{
. . .
}
Referring to the sample code above, which one of the
following lines of code produces a written description of
the type of exception that "e" refers to?
a) cout << e.type();
b) cout << e.name();
c) cout << typeid(e).name();
d) cout << e.what();
e) cout << e;
| Quark | 2 |
| What is the use of static functions? | Symphony | 6 |
| why can't we declare data member of class auto register or
extern | | 1 |
| What are inline functions? | Verizon | 2 |
| If P is the population on the first day of the year, B is
the birth rate, and D is the death rate, the estimated
population at the end of the year is given by the formula:
The population growth rate is given by the formula:
B – D
Write a program that prompts the user to enter the starting
population, birth and death rates, and n, the number of
years. The program should then calculate and print the
estimated population after n years. Your program must have
at least the following functions:
1. growthRate: This function takes its parameters the
birth and death rates, and it returns the population growth
rate.
2. estimatedPopulation: This function takes its
parameters the current population, population growth rate,
and n, the number of years. It returns the estimated
population after n years
Your program should not accept a negative birth rate,
negative death rate, or a population less than 2.
| | 1 |
| |
| For more C++ General Interview Questions Click Here |