Microsoft Interview Question for Software Engineer in Tests


Team: IE
Country: United States




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

Abstract class cannot instantiate means it cannot create a object!
Lets say a Shape abstract class, has triangle and circle derived classes.
you cannot have a object which is just a shape, it MUST BE either a triangle or a circle..
the reason for abstract class is to put this MUST BE condition!

- ravi March 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The abstract class is desgined in a way that developers can use/inherit the basic functionality of the class, but doesn't forget to implement their additional logic. Some function may or may not be overridden depending on the need.

- whizz.comp March 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

abstract classes are too abstract to instantiate. if you were allowed to instantiate it then you would have to provide method definitions in all the abstract methods instead of leaving them blank.

- Anony March 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@ariesgirl069 - what other questions were asked during your interview?

- Anonymous March 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think the interviewer wants you to talk about pure virtual function(assuming it's C++).

- liulu.lou March 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think it could be thinked in two aspects.
First, from the perspective of philosophy, abstract class could not represent a real object. Say if someone asks you to buy a fruit, but don't tell you which kind of fruit, nothing could be bought.
Second, supposing an abstract class can be instanced, then the compiler needs to know how to handle a symbol like virtual void foo()=0; Here the symbole foo doesn't have a body, so compiler cannot put it in .text section, therefore it doesn't have address, just a null symbol. Further more, compiler also needs to ensure that no function calls is made to foo(). So a class has an instance but some of its methods cannot be accessed (we cannot just force all pure virtual functions must be declared as private), what it looks like? A black hole in language.

- Dongming March 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

because virtual table will have null function pointers

- arn March 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Lets say,we have an abstract class named Vehicle.We may use the fields,properties and member functions defined within this abtract class to create child classes like Car,Truck, Bike etc. that inherit the features defined within abstract class.To prevent directly creating an instance of the class Vehicle,we make use of the abstract keyword.To use the definitions defined in the abstract class, the child class inherits from the abstract class, and then the instances of the child class may be easily created.

- Vidhi May 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

what should i do to get details out from an abstract class?

- john November 13, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

what will we do in an abstarct class,if we need to call its method to perform an action as it cn't be instantiated??

- peterthomas487 November 13, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

?

- peterthomas487 November 17, 2012 | 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