[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Technical Interview Questions and Answers :: C++

    21 / 187

    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 :

    22 / 187

    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 :

    23 / 187

    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 :

    24 / 187

    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 :

    25 / 187

    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 :

    26 / 187

    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 :

    27 / 187

    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 :

    28 / 187

    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 :

    29 / 187

    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 :

    30 / 187

    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 :