Bloomberg LP Interview Questions
- 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
AnswersFind the middle element of a singly linked list.
- Anonymous March 25, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - 0of 0 votes
Answerdiff b/w java and c#... Details of how garbage collector works..
- Anonymous March 23, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer - 0of 0 votes
AnswersDifficult bug and how you resolved it.
- Anonymous March 23, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Behavioral - 0of 0 votes
AnswersGenerate anagrams. complexity
- Anonymous March 23, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - 0of 0 votes
AnswersThere are 3 files in a program.
- Bandicoot March 23, 2010
// File: foo.c
static int var;
void foo()
{
var++;
}
// end of file foo.c
// File bar.c:
static int var;
void bar()
{
var++;
}
// end of file bar.c
// file main.c
static int var;
void main()
{
foo();
bar();
printf("%d", var);
}
// end of file main.c
Question: Will the above program compile ? If so what will be the result ?| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C - 0of 0 votes
AnswersProbability question: Persons A and B go shopping together. Say person A spent X amount of money and B Y. What is the probability that the sum total of their purchases [i.e. X+Y] has 0 cents [i.e. is a whole number]. ?
- Bandicoot March 23, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Brain Teasers - 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++ - 0of 0 votes
Answerswrite the prototype for strcat function in C
- foobar March 22, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C - 0of 0 votes
Answerswhy do u want to work at bloomberg
- foobar March 22, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Behavioral - 0of 0 votes
Answerswrite a function that accepts an array, a number. it need to find the first two numbers in the array to have the sum as the number passed. You know the length of the array
- Anonymous March 21, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswerStatic members,
- Siva March 20, 2010
What are they?
Their reason of existence?
Challenges they have? (Link initilization)......| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersI/P: Set of Words
- Siva March 20, 2010
O/p: Group anagrams and print them on same line.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
Answersclass Person{ public: Person(const char* szName); const char* GetName() const; /*put a function here*/ private: char *m_szName; }; int main() { Person person("John"); std::cout << Person; return 0; }
Referring to the sample code above, which one of the following member
- diamondlcd March 18, 2010
functions do you add at the comment to support std::cout << person
statement?
A. std::string operator() { return GetName(); }
B. std::string ToString() { return GetName(); }
C. const char* Convert() const { return GetName(); };
D. char* operator char*() const { return GetName(); };
E. operator const char*() const { return GetName(); };| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersWhy does your class have a pure virtual function?
- diamondlcd March 18, 2010
A. To ensure that this function is overridden in derived classes
that are to be instantiated
B. To allow for templated classes to be used with friend functions
C. To maximize the memory efficiency provided that execution speed
is not at a premium
D. To maximize code reuse
E. To maximize the execution speed of the function provided that
memory is not at a premium| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersWhats the size of a derived object ? How would you calculate it ? Does it include size of base class size?
- guest March 15, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersCan you do this : Derived *d = new Base()
- guest March 15, 2010
Where base has a virtual func foo() that is also implemented in derieved.
What are the implications ? (Note: its opposite of what one does for polymorphism..)| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersHow do you perform error handling in destructors ? (throws Exceptions?)
- guest March 15, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersGiven 5 prices of a share for 5 days i.e. from Monday-Friday share prices for a perticular share are $1, $4, $5, $2, $3. Find the max profit you could make in a given week. You are not allowd to do multiple trading in a day and its not mandatory to do trading on each day. Write a C code for this.
- guest March 02, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C - 0of 0 votes
Answers1. Explain OOP,classes,inheritance and polumorphism.
- guest March 02, 2010
2. Difference between C,C++.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
Answerschar a[] = " ";
- TopCoder February 26, 2010
Q. What will be sizeof(a)| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
Answersclass Foo {
- TopCoder February 26, 2010
public:
void virtual abc() throw (int , double, long) {
};
};
class DFoo : public Foo {
public :
void abc() throw (double , int , long ) {}
};
// Will it compile
int main(){
DFoo d;
return 0;
}| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersGo through all the C++ Qs put on careercup , in online test most of these Qs repeat .
- TopCoder February 26, 2010
// Online Test
class Someclass {
public:
int x;
public :
Someclass(int xx) : x(xx) { }
Someclass(const Someclass& a) { x = a.x ; x++;}
Someclass& operator =(const Someclass& a1) { x = a1.x ; x--;}
};
int main( )
{
/*Someclass a(4);
Someclass b = a;
}
Q. What will be output| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 2 votes
Answers//Online Test
- TopCoder February 21, 2010
extern void print(int *ia, int sz);
void print(int *ia, int sz);
Q. Will it compile| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++ - 0of 0 votes
Answers//Online Test
- TopCoder February 21, 2010
struct A{
int i , j;
A(int ii , int jj) :i(ii),j(ii){}
A(const A&a){
cout << a.i << a.j;
}
void operator = (const A& a){
cout <<a.i << a.j
}
};
Q. A a(1,2);
A b(2,3);
A z = (a = b);
what will be output| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer C++