Amazon Interview Question for Developer Program Engineers






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

Normal virtual function never call base functions where as virtual destructor call base virtual destructor in Epilog.

- Ashish February 14, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

The virtual destructor invokes the derived class destructor dynamically. After this it calls the immediate base class destructor statically. This sequence of destructors gets called from the the class derivations in the reverse order.

- Anonymous February 14, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

When derived class object is deleted using the pointer of base class object, both destructor functions of derived class and base class gets invoked. In case of simple virtual function call using base class pointer, only derived class function
gets invoked.

- Anonymous February 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Compilers are responsible for calling destructors as well as constructors when object is deleted or created respectively ). So in case of virtual destructors compiler makes sure both derived class followed by base called descrutors are called i.,e in reverse order of creation. This would ensure cleanup of the object completely and cleanely

- Anonymous February 26, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

-Virtual destructor doesn't need V-table creation.
-Destructor can't be override in child class.
-If you are making it pure virtual, you have to provide definition in base class itself.

- manish2you September 24, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Don't think statement one is true. To be clear compiler actually generates v-tables for virtual method there could be compiler designed which doesn't implement vtable for virtual methods

- mvishnu2005 March 10, 2012 | Flag


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