C++ Interview Questions
- 0of 0 votes
AnswersYou have a class that many libraries depend on. Now you need to modify the class for one application. Which of the following changes require recompiling all libraries before it is safe to build the application?
- Anonymous July 31, 2010
a. add a constructor
b. add a data member
c. change destructor into virtual
d. add an argument with default value to an existing member function| Report Duplicate | Flag | PURGE
Interactive Brokers C++ Object Oriented Design - 0of 0 votes
AnswersYour task is to implement the Reduce function using templates. The Reduce fn applies a function of two arguments cumulatively to the items of an STL container, from begin() to end(), so as to reduce the sequence to a single value. For example, Reduce(<list containing 1,2,3,4,5>, std::plus<int>()) should calculate ((((1+2)+3)+4)+5).
- Anonymous July 31, 2010
class NotEnoughElements {};
template <typename Container, typename Function>
typename Container::value_type
Reduce(const Container& c, Function fn) throw (NotEnoughElements)
{
Fill here
}| Report Duplicate | Flag | PURGE
Interactive Brokers C++ - 0of 0 votes
Answerwhat are the default members created by the compiler when a class is created.
- sunny July 30, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerswhat is the difference between vector and list
- sunny July 30, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerswhat is the difference between hashmap and map
- sunny July 30, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerscan we have template virtual functions
- sunny July 30, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerswhat is polymorphism
- sunny July 30, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerswhat is V table
- sunny July 30, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answeruse of static in c++
- sunny July 30, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerswhat is initialization list and when is it used
- sunny July 29, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerswhat is the difference between vector and list
- Anonymous July 29, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerhow Vtable works
- Anonymous July 29, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerwhat are the default members created by compiler for a class
- Anonymous July 29, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersDifference between const char *p and char * const p?
- Anonymous July 28, 2010| Report Duplicate | Flag | PURGE
FlexTrade Software Engineer / Developer C++ - 0of 0 votes
AnswersWhat is the use of virtual destructors ?
- Anonymous July 28, 2010| Report Duplicate | Flag | PURGE
FlexTrade Software Engineer / Developer C++ - 0of 0 votes
AnswersIs something wrong in the following code:
- fiddler.g July 25, 2010
int cast(int*=NULL) { return 0; }| Report Duplicate | Flag | PURGE
Software Engineer / Developer C C++ - 0of 0 votes
AnswersThis was asked in my bloomberg interview.
- Indian July 24, 2010
pure virtual function is one defined as =0;
ex: int foo()=0.
Is following valid ?
class A{
public:
int foo(void)=0;
};
A::foo(void )={};
That is can we have a function as pure virtual function and also have defination like above ?
Justify your answer. If yes, then tell me one situation where we use that.
If not tell me why not.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersThe private member in derived class
- WinXP July 16, 2010
Answer: Can be inherited only if the derived class is inheriting from base class with private access level
This is an on-line test. I don't know what the answer means.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
AnswerUsing pointers to call a function is called as Answer: call by reference
- anonymous July 16, 2010
This is a multiple-choice question from on-line test. The statement above is a correct answer but I don't know why it is called call by reference.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
AnswersThe private member in derived class can be inherited only if the derived class is inheriting from base class with private access level
- anonymous July 16, 2010
This is a multiple-choice question from on-line test. The statement above is a correct answer but I don't know what it means.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
AnswersC++ Variable Scoping
- Siva July 15, 2010
- Local
- Global
- Dynamic| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersWhat is the difference between function overwritting and function overloading
- Anonymous July 08, 2010| Report Duplicate | Flag | PURGE
FactSet Research Systems, Inc Software Engineer / Developer C++ - 0of 0 votes
AnswersWhat is bridge pattern? Asked me to write skeleton of bridge pattern.
- callbacker June 25, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
AnswersThere are different types of GUI themes, and there are different types of buttons. When a user pushes a button, its outcome depends on the type of GUI theme selected, and the type of button pressed. Discuss your design approach.
- callbacker June 25, 2010
(Hint: double dispatch)| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
AnswersAsked a design problem where observer pattern fits perfectly.
- callbacker June 25, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
AnswersAsked about RAII, auto_ptr, shared pointer.
- callbacker June 25, 2010
Can we have containers of std::auto_ptr?| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
AnswersWhats the use of reserve() method in vector? How does vector compare to a deque in terms of performance of push_back()'s.
- callbacker June 25, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
Answers1. A* a=new A();
- Xinyu Huang June 22, 2010
2. A b;
A *c=&b;
What is the difference between 1 and 2?| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
Answersvoid foo(A a){}
- Xinyu Huang June 22, 2010
A* a =new A();
foo(*a);
A b=*a;
b=*a;
How many copy ctors of class A are called?| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++