C++ Interview Questions
- 0of 0 votes
Answersexception handling. can we throw different type of object in re throw ?
- Keyur April 21, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerswhat happens if I throw exception from destructor. can I throw exception from construtor and destructor ?
- Keyur April 21, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answersis template class compilation static or dynamic binding ?
- Keyur April 21, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answersthere is template class with syntax errors and in main prog there is nothing.
- Keyur April 21, 2010
will it throw compile errors ?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswerWhat are virtual functions?
- dnivra April 21, 2010| Report Duplicate | Flag | PURGE
Riverbed Software Engineer / Developer C++ - 0of 0 votes
Answersdifferent between exec and fork. will parent process and child process
- Keyur April 20, 2010
in deadlock if parent is using resource and child will also get same resource ?
what if parent contains two threads ? will child also get 2 threads ? how fork will be thread safe ?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Threads C++ - 0of 0 votes
AnswersWhat's the three types of memory allocated for C++ variables?
- ttgg April 13, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerswhere is global variable (defined outside any function or class) allocated, heap or stack?
- ttgg April 13, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answersyou have a class A, where you set ctor to be private, so a client can't call
- ttgg April 13, 2010
"A a;"
to create obj on stack.
But someday another developer add a new ctor:
"A(int)"
and try to call "A a(1);" inside main(). So this will create a obj on stack. How do you prevent that?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answersdiff between pointer and reference
- Anonymous April 12, 2010| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer C++ - 0of 0 votes
AnswersHow can you lock a portion of a file and how to use it ?
- ak April 08, 2010| Report Duplicate | Flag | PURGE
C C++ - 0of 0 votes
Answersclass A{ int i;
- ak April 06, 2010
public:
A(int j):i(j){}
};
class B{int i;
public:
B(int j){i=j;}
};
Which one is faster..uisng the initializer list or initializing in the c'tor body....
Is there any other diff or both will have same performance...??| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersMemory Resize Function
- Keyur March 31, 2010
Lets say contiguous memory is not available for vector's elements and it is occupied by something else. How does the resize function of vector allocate memory to be contiguous allocation?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answersvector and list difference. complexities of alogrithms.
- Keyur March 31, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answersif base class function and overriding function has different return type how it will impact into main program. lets say base class function is returning int which is virtual and derived class function is returning is String.
- Keyur March 30, 2010
and I have base* b = new derived()
so can I call int i = b->function() which is derived class function returning string?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answerswhat is conversion operator? Can you convert 1 object into another object using this? if yes How? if not why not?
- Anonymous March 28, 2010| Report Duplicate | Flag | PURGE
C++ - 0of 0 votes
AnswersHave you overloaded operator new ? I said yes then Y did u do that ?
- sachin323 March 28, 2010| Report Duplicate | Flag | PURGE
FlexTrade Software Engineer / Developer C++ - 0of 0 votes
AnswersHow will you overload << operator for output? Why you have to make it friend ?
- sachin323 March 28, 2010| Report Duplicate | Flag | PURGE
FlexTrade Software Engineer / Developer C++ - 0of 0 votes
AnswerWhat are problems with shallow copy ?
- sachin323 March 28, 2010| Report Duplicate | Flag | PURGE
FlexTrade Software Engineer / Developer C++ - 0of 0 votes
AnswersDo know STL , tell me what kind of containers are available , complexities of each ?
- sachin323 March 28, 2010| Report Duplicate | Flag | PURGE
FlexTrade Software Engineer / Developer C++ - 0of 0 votes
AnswersWhat is the main reason for using pass by reference over pass by pointer
- dagnihot March 27, 2010| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer C++ - 0of 0 votes
Answershow to initialize the reference member varibale in a class?
- Reliance Tech Services March 26, 2010| Report Duplicate | Flag | PURGE
Roamware Software Engineer / Developer C++ - 0of 0 votes
AnswersWhy is this not allowed in C++ ? Explain problems with this approach
- tim March 23, 2010
Derived *d = new Base()| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersIf I create an object of class Foo, and send its address and sizeof to memset and set it all to 0, will it work? I answered yes, it ll set it to 0.
- foobar March 22, 2010
then he asked, if everything sets to 0, will u still be able to call functions? i answered yes, but if the function uses any data, it might not work, as data would have been corrupted.
he asked, will any function not work? yes, if there are virtual functions, call to virtual functions will fail, as pointer to vtable will be corrupted.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
Answersimplement a function to_dollar(int a) that takes in an int, say '10200', and prints $10,200.
- foobar March 22, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++