Technical Interview Questions and Answers :: Sopra Steria
- Select All
- SQL
- Java
- C++
- Informatica
- C
- DBMS
- Data Structure
- HR Question in TR
21 / 138
There are 5 forms available, namely
• Single inheritance: A derived class with only one base class
• Multiple inheritance: A derived class with only several base class
• Hierarchical inheritance: The traits one class may be inherited by more than one class
• Multilevel inheritance:
• Hybrid inheritance: it is a combination of multiple and hierarchical inheritance.
22 / 138
Two or more functions can share the same name that perform a variety of different tasks as long as their parameter declarations are different. The functions that share the same name are said to be overloaded, and the process is referred to as function overloading.
23 / 138
Visibility mode is optional and may be either private or public. The default visibility mode is private. Visibility mode specifies whether the features of the base class are privately derived or publicly derived.
Ex:
Class abc: private Xyz // private derivation
{
members of abc;
};
Ex:
Class abc: private Xyz // public derivation
{
members of abc;
};
24 / 138
Like class template, we can also define function templates that would be used to create a family of function with different argument types.
Syntax:
Template
return type function name(argument of type T)
{
………..
//body of function
//with type T
//wherever appropriate
}
We must use the template parameter T as and when necessary in the function body and in its arguments list.
25 / 138
A collection of generic classes and function is called the standard template library (STL). STL components are part of c++ standard library. STL consist of three main components. They are
• Containers
• Algorithms
• Iterators
26 / 138
No Discussion on this question yet!
27 / 138
No Discussion on this question yet!
28 / 138
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
29 / 138
No Discussion on this question yet!
30 / 138
No Discussion on this question yet!