Comp Sc - Viva Q & A (1)
Comp Sc - Viva Q & A (1)
i. What is an array?
Ans : An array is a collection of elements of same name and same type.
ii. What is insertion operation with respect to data structure? (Exclusively
asked for inserting an element into an array program )
Ans : It is a process of inserting a new element into an existing array.
iii. What is deletion operation with respect to data structure? (Exclusively
asked for deletion an element from an array program )
Ans : It is a process of removing an element from an existing array.
iv. What is searching? (Exclusively asked for Binary search program )
Ans : It is a process of finding an element and its location from an array.
v. What is the condition to apply binary search technique to search an
element in an array (Exclusively asked for Binary search program )
Ans : Elements should be in the sorted order (Ascending or Descending
order)
vi. What is sorting? (Exclusively asked for Sorting program)
Ans : It is a process of arranging the elements in ascending or
descending order.
vii. Give an example for the primitive data structure
Ans : int , char , float , double
viii. Give an example for a linear data structure
Ans : array , stack , queue
ix. Give an example for non-linear data structure
Ans : Graph and Tree
10. Write a program to find the sum of the series 1+x+x2+...+xn using constructor.
VIVA QUESTION AND ANSWERS
i. What is a constructor?
Ans : It is a special member function which has the same name as that
of a class used to initialize objects.
ii. When does a constructor is invoked?
Ans : It is invoked automatically when an object is created
iii. Mention the types of constructor.
Ans : Default Constructor, Parameterised constructor and Copy
Constructor
iv. Which section of a class a constructor can be defined.
Ans : Public Section
11. Create a base class containing the data members roll number and name. Also
create a member function to read and display the data using the concept of single
level inheritance. Create a derived class that contains marks of two subjects and
total marks as the data members.
VIVA QUESTION AND ANSWERS
i. What is inheritance?
Ans : It is a process of one class acquiring the properties of another class
ii. What is a base class?
Ans : It is a class from which other classes are derived.
iii. What is derived class?
Ans : It is a class which is derived from the base class.
iv. Mention the operator used to create a derived class in C++
Ans : colon (:)
12. Create a class containing the following data members register No., name and
fees. Also create a member function to read and display the data using the
concept of pointers to objects.
VIVA QUESTION AND ANSWERS
i. What is a pointer?
Ans : It is a variable which holds the address of another variable.
ii. Mention the address operator in C++
Ans : &
iii. Which operator is used to allocate memory dynamically?
Ans : new operator
iv. Which operator is used to deallocate memory dynamically?
Ans : delete operator
PART-B
(HTML)
(SQL)