[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++

    11 / 187

    What is a predicate?
    Answer:

    A predicate is a function object (or a function) that returns a bool.

    Please Login First :

    12 / 187

    What is function object?
    Answer:

    An object of a class with an application operator is called a function. Like object, a function or simply functions object. Consequently, function objects often execute faster than do ordinary function.
    (or)
    An object that acts like a function is often called function like object (or) simply function. Such function objects are important because they allow us to write code that takes operations as parameters.

    Please Login First :

    13 / 187

    What are arithmetic function objects?
    Answer:

    When dealing with numeric classes, it sometimes useful to have the arithmetic function available as function objects. Consequently the standard library provides arithmetic operations.
    plus binary arg1 + arg2
    minus binary arg1 - arg2
    multiplies binary arg1 * arg2
    divides binary arg1 / arg2
    modules binary arg1 % arg2
    negate Unary -arg1

    Please Login First :

    14 / 187

    Define Non-modifying sequence algorithm?
    Answer:

    These algorithms are provided to do the most common forms of updates. Some update a sequence while others produce a new sequence based on information found during a traversal.
    Std. algorithm work on data structures thru Iterators. This implies that inserting a new element into a container (or) deleting one is not easy.

    Please Login First :

    15 / 187

    What is meant by binder?
    Answer:

    A binder allows a two-argument function object to be used as a single-argument function by binding one argument is a value.

    Please Login First :

    16 / 187

    What are member function adapter & pointer to function adapter?
    Answer:

    A member function adapter allows a member function to be used as an argument to algorithms.
    A pointer to function adapter allows a pointer to function to be used as an argument to the algorithm.

    Please Login First :

    17 / 187

    What is meant by concrete types?
    Answer:

    Classes such as vector, list, date and complex are concrete in the sense that each is the representation of a relatively simple concept with all the operations essential for the support of that concept.
    Each has a one to one correspondence between its interface and an implementation and none are intended as a base for derivation.

    Please Login First :

    18 / 187

    What are the aims of concrete types?
    Answer:

    The aims of concrete type classes are:
    i. To be a close match to a particular concept and implementation strategy.
    ii. To provide run-time and space efficiency comparable to handcrafted code through the use of in-lining and of operations taking full advantage of the properties of the concept and its implementation.
    iii. To have only minimal dependency on other classes; and
    iv. To be comprehensible and usable in isolation.
    v. Providing a clear and efficient representation of a single concept.

    Please Login First :

    19 / 187

    what are the important points to remember while using concrete types?
    Answer:

    i. Concrete types are fitted into a hierarchy of related classes.
    ii. Each concrete type can be understood in isolation with minimal reference to other classes.
    iii. If a concrete type is implemented well, programs using it are comparable in size and speed to programs a user would write using a hand-crafted and specialized version of the concept.
    iv. If the implementation changes significantly the interface is usually modified to reflect the change.
    v. Concrete type resembles in the built in type.

    Please Login First :

    20 / 187

    What are the advantages of concrete type over abstract type?
    Answer:

    i. An individual concrete classes are easier to understand and use then is a more general class.
    ii. Concrete type is often used for classes that represent well-known data types such as arrays and list.

    Please Login First :