Qualcomm Interview Question for Software Engineer / Developers






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

http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.5

- Veena September 04, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

a nice link

- leakymemory September 23, 2009 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

WTF.
you can call virtual methods from derived class constructor. you cannot call virtual methods from base class constructor because, when you are creating the derived class object, first base class constructor is invoked and the base class object type is created. at this time, your derived class object is not yet created completely(only base class object part is created). so calling virtual method can be a problem. thats the reason c++ language doesn't allow you to call virtual methods in base class constructor.

You can perfectly call virtual methods in derived class constructor becuase the object is created.

- Arun October 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Veena thank for the nice link!

- koki September 04, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

veena i love you

- veena i love you August 04, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

But that link doesnt explain this question's answer, does it?

- Gq September 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

To avoid calling unexpected method (ie: in base class)

- Anonymous October 08, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You can call a virtual method from a derived class constructor but it would loose its meaning because it will call its own base implementation. This happens because "this" pointer within base constructor(called automatically when derived constructor is called) is of base type and therefore it will call its own implementation and the expected would be of derived.

- Ashish October 17, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think question is wrong.. it should be "Base class" instead on derived class. Calling a virtual function from the derived class is perfectly fine.

- kk November 10, 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