Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions

Technical Interview Questions and Answers :: C++

    141 / 184

    What is meant by abstract type?
    Answer:

    i. A class is said to be abstract class that represents the interface to a set of implementations of a common concept.
    ii. The abstract class provides the common interface to the implementation. This means, we can use a set without knowing which kind of implementation is used.

    Please Login First :

    142 / 184

    Differentiate between concrete type and abstract type.
    Answer:

    Concrete type:

    1. We require a redesign of the implementation classes to express commonality and issued a template to exploit it.
    2. If the implementation changes significantly the interface is usually modified to reflect the change.

    Abstract type:

    1. Design a common interface but no commonality beyond re-ability to implement the interface.
    2. Users need not depend on these declarations and need not be recompiled or in any way changed if set changes.

    Please Login First :

    143 / 184

    What are the aims of abstract types?
    Answer:

    i. Define a single concept in the array that allows several implementations of it to coexist in a program.
    ii. Provide reasonable run-time and space efficiency through the use of virtual functions .
    iii. Each implementation have only minimal dependency on other classes.
    iv. Comprehensible in isolation.

    Please Login First :

    144 / 184

    Why do we have concrete types when we have abstract type?
    Answer:

    i. Efficiency : - We want to have concrete types such as vector and list without the overheads implied by decoupling the implementations from the interfaces.
    ii. Reuse : - We need a mechanism to fit types designed elsewhere into a new library or application by giving them a new interface.
    iii. Multiple interfaces : - Using a single common base fro a variety of classes leads to fat interfaces. Often it is better to provide a new interface to a class for new purposes rather than modify its interface to serve multiple purposes.

    Please Login First :

    145 / 184

    What is node class.
    Answer:

    A node class relies on services from base classes to provides its own services. That is, it calls base class member functions. A typical node class provides not just an implementation of the interface specified by its base class. It also adds new functions itself, thus providing a wider interface.

    Please Login First :

    146 / 184

    What are the important functions of node class?
    Answer:

    The important functions are the constructor through which the programmer specifies the basic properties that are relevant to the simulation and the virtual functions that allow the simulation routines to manipulate a public variable without knowing its exact type.

    Please Login First :

    147 / 184

    What are the aims of node classes.
    Answer:

    i. relies on its base classes both for its implementation and for supplying services to its users.
    ii. Provides a wider interface (i.e an interface with more public members) to its users than do its base classes.
    iii. Relies primarily on virtual functions in its public interface.
    iv. Depends on all of its( direct and indirect) base classes.
    v. Can be understood only in the contest of its base classes.
    vi. Can be used as a base for further derivation.
    vii. Can be used to create objects.

    Please Login First :

    148 / 184

    What is meant by concrete node types?
    Answer:

    A class that does not confirm to point base for further derivation resembles on concrete type and could be called as concrete node types.

    Please Login First :

    149 / 184

    What is meant by leaf classes?
    Answer:

    A concrete node class can be used to implement an abstract class and variables of such a class can be allocated statically and on the stack. Such a class is sometimes called as leaf class.

    Please Login First :

    150 / 184

    What is meant by abstract node class?
    Answer:

    A class that does not confirm to create objects resembles on the abstract type and it is called as abstract node types.

    Please Login First :



You can check latest and updated C++ Inheritance Interview Questions and Answers on this page. You can filter the question set by the company's name. Looking for the right answer? Don't worry! You can click on view answer section and check the answer with the explanation. You can discuss the answer in the forum with other users easily. Login with Facebook and save the answer To Reading List right now!

Our site contains top IT companies placement paper and mock test to help the freshers and experienced candidate to get hands on experience on the pattern and type of questions. We have curated all the C++ technical interview questions and answers from previous candidates.