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

    121 / 184

    Define sequence container?

    Sequence container stores elements in a linear sequence like a line .Each elements are related to other by its position along the line. They all expand themselves to allow insertion to the elements and all of them support a number of operations on them.

    Element0 -> Element1 -> Element2 -> …….. -> Last element…


    Begin() end()

    Please Login First :

    122 / 184

    What is meant by associative container?

    Associative containers are designed to support direct access to elements using keys. They are not sequential. There are 4 types of container:
    • set
    • multiset
    • multimap
    • map

    All these containers stores data in a structure called tree which facilities fast searching, deletion and insertion.

    Please Login First :

    123 / 184

    Define derived container?

    The STL provides three derived containers namely:
    Stack, queue and priority queue. These are known as Container adaptors.
    These can be created for different sequence container and it does not support the Iterators and therefore we cannot use them for data manipulation.
    However, they support two member functions pop() and push() fro implementing deleting and inserting operation.,

    Please Login First :

    124 / 184

    What is meant by algorithm?

    Algorithms are a function that can be used generally across a variety of containers for processing their contents.

    Please Login First :

    125 / 184

    What is meant by STL algorithm?

    STL algorithm reinforce the philosophy of reusability. By using these algorithms, programmers can save a lot of time and effort.
    To access STL Algorithm we must be included in our program.

    Please Login First :

    126 / 184

    What are the categories of STL algorithm?

    STL algorithm based on the nature of operations it may be categorized s follows:
    • retrieve or non-mutating algorithm
    • Mutating algorithm
    • Sorting algorithm
    • Set algorithm
    • Relational algorithm

    Please Login First :

    127 / 184

    What is meant by list?

    The list is another container that is popularly used. It supports bidirectional, linear list and provides an efficient implementation for deletion and insertion operation. Unlike a vector, which supports random access, a list can be accessed sequentially only.
    Write some important member functions of the list class?

    Function Task
    Back() Gives a reference to the last element
    Begin() Gives a reference to the first element
    Clear() Deletes all the elements
    Empty() Decides if the list is empty or not
    End() Gives refernce to the end of the list
    Erase() Deletes elements as specified
    merge() Merge two ordered list
    Insert() Insert elemements as specified
    Pop_back() Deletes the last element
    Pop_front() Deletes the first element
    Push_back() Adds an element at the end
    Push_front() Adds an element at the front

    Please Login First :

    128 / 184

    What is meant by map?

    A map is a sequence of key value pairs that provides for fast retrieval based on the flag. Almost one value is held for each key; in other words, each key in a map is unique.

    Please Login First :

    129 / 184

    What is a multimap?

    A multimap is a map, except that it allows duplicate keys. Naturally several values can exist for a single key. A multimap is preferred over a map. In some ways, a multimap is even cleaner and more elegant than a map.

    Please Login First :

    130 / 184

    How is an iteration over a map is carried out?

    Iteration over a map is simply iteration over a sequence of pair < const key, mapped_type >. For e.g. We might print out the entries of a phone book like this
    Void f(map& phone_book) {
    Typedef map(string, number)::const_iteration CI;
    For(CI =phone_book.begin( ); p!=phone_book.end( );++p)
    A map iterator presents the elements in ascending order of its keys.

    Please Login First :

You can check latest and updated Honeywell C++ 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.