Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

Technical Interview Questions and Answers :: Societe Generale

30.05K

Tot. Mock Test: 3


Total Qs: 75+

  •  Select All
  •  Oracle PLSQL
  •  SQL
  •  Java
  •  C++
  •  Informatica
  •  WebMethod
  •  DBMS
  •  C
  •  Soft. Engineering
  •  Data Structure
  •  HR Question in TR

    1 / 75

    Write a program to reverse the given string.
    Answer:

    No Discussion on this question yet!

    Please Login First :

    2 / 75

    Can we implement all the concepts of OOPS using the keyword struct?
    Answer:

    Yes, struct is similar to class, only all attributes/methods are public by default in the struct. You can very well have methods and attributes in a struct. You can also inherit from a struct (default inheritance is public).

    Please Login First :

    3 / 75

    What is the difference between class and structure?
    Answer:

    1. Members of a class are private by default and members of struct are public by default.


    2. 'struct' is the keyword for Structure and 'class' is the keyword for Class.


    3. Structure is used for smaller amount of data and Class is used for larger amount of data.


    4. Structure is usually as for grouping of data and Class is for inheritence and further abstraction.


     

    Please Login First :

    4 / 75

    Can we create an empty class? If so what would be the sizeof such object.
    Answer:

    Yes, Size of an empty class is not zero. It is 1 byte generally. It is nonzero to ensure that the two different objects will have different addresses.

    Please Login First :

    5 / 75

    What Is Inheritance? What is the diamond problem that can occur with multiple inheritance? Explain an example.
    Answer:

    Inheritence is deriving parent(base) class properties to derived class.


    The Diamond Problem :


        A


       /  \


      B   C


       \   /


        D


    Now Class B

    Please Login First :

    6 / 75

    What is Copy Constructor? Write a program using it.
    Answer:

    Copy constructor is used to declare and initialize an object from another object.
    For example, the statement
    Integer I2(I1);
    Would define the object I2 and at the same time initialize it to the values of I1. another form of this statement is integer I2=I1;
    The process of initializing through a copy constructor is known as copy initialization. A copy constructor takes a reference to an object of the same class as itself as an argument.

    Please Login First :

    7 / 75

    Why the size of empty Class is one byte? OR What will the sizeof empty Class ?
    Answer:

    No Discussion on this question yet!

    Please Login First :

    8 / 75

    Explain overloading the delete operator.
    Answer:

    Syntax:

    void operator delete(void *p)
    {
    /*free memory pointed to by p. the destructor is called automatically.*/
    }

    The delete function receives a pointer to the region of memory to be freed. It then releases the previously allocated memory back to the system. When an object is deleted, its destructor is automatically called.

    Please Login First :

    9 / 75

    What is default constructor. Give example?
    Answer:

    A constructor that accepts no parameters is called the default constructor. The default constructor for class A is A::A ( ). If no such constructor is defined, then the compiler supplies a default constructor. Therefore a statement such as A a;
    Invokes the default constructor of the compiler to create the object a.

    Please Login First :

    10 / 75

    How to declare and define constructor?
    Answer:

    A constructor is declared and defined as

    Class integer
    {
    int m,n;
    public:
    integer(void); //constructor declared
    ……….
    ………..
    };
    integer : : integer(void)//constructor defined
    {
    m=0;
    n=0;
    }

    Please Login First :


Most Frequent Qs.