Bloomberg LP Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

// Dynamic Allocation of objects and Polymorphism

#include<iostream>

using namespace std;

class Person {
int i;
public:
virtual void foo() = 0;
};

class Student : public Person {
void foo() {
cout << "I am a Student\n" ;
}
};


class Professor : public Person {
void foo() {
cout << "I am a Professor\n" ;
}
};


int main(){

Person *person1 = new Student;
Person *person2 = new Professor;

person1->foo();
person2->foo();

delete person1;
delete person2;
return 0;
}

- newbie October 02, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Polymorphism includes both overloading and overriding.

- letsgo October 02, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

- Pure/ Virtual function (Run Time)
- Function Overloading (Compile Time)
- Operator Overloading (Compile Time)

- YetAnotherCoder October 03, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

i like YetAnotherCoder's explanation/reasoning...he's absolutely correct!

- assHo August 18, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Static polymorphism (Using templates) was left out.

- Swamy October 12, 2009 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More