You are on page 1of 6

COMPUTER SCIENCE VIVA QUESTIONS-2020

Section –A
C++

1. What is object and class in OOP?


Object is an instance of a class.
Class is collection of similar objects.
A class binds data members and member functions together.
2. Define data abstraction and polymorphism.
Abstraction refers to the act of representing essential features of an entity without
including explanations or any background details about it.
Polymorphism is derived from two Latin words poly (many) morphos (forms)
The concept of using operators or functions in different ways, depending on what they
are operating on, is called polymorphism.
3. List the access specifiers used with a class. Name the default access specifier.
• Private
• Public
• Protected
The default access specifier is private
[Access specifiers define the scope of the data]
4. Differentiate private and public access specifiers in c++.
Private Public
The members declared as "private" can be The members declared as "public" are
accessed only within the same class and not accessible within the class as well as from
from outside the class. outside the class.

5. Which operator is used to access the members of a class?


Dot [.]Operator is used to access the members of a class.
6. What is the significance of scope resolution operator?
➢ Scope resolution operator (::) is used to define the member function outside the
class.
➢ To access global variable, that has same name as local variable.
➢ To resolve ambiguities or uncertainty during multiple inheritance.

7. What is an array? Mention the disadvantages of an array.


An array is a collection of elements of same data type referred by a single name.
Disadvantage:

• Array is static structure.


• We must know in advance that how many elements are to be stored in array.
• Since array is of fixed size, if we allocate more memory than requirement then the
memory space will be wasted.
8. Define sorting
The process of arranging elements either in ascending or descending order is called
sorting.

1
9. What is meant by function overloading?
Function overloading is a concept where a program can have two or more functions with
the same name, but each function differing in the number and data type of arguments
called signature of the function. Function overloading is an example of polymorphism.

10. Define inline function. Mention one advantage.


It is a special member function whose function call is replaced by function body.
Advantages

● Inline function increases the speed of execution*


● The readability of the program increases*
● Very efficient code can be generated.
● The inline member functions are compact function calls, thereby the size of the
object code is considerably reduced.

11. What is constructor? Mention types.


A constructor is a special member function that is used in classes to initialize the objects
of a class automatically. It has same name as that of the class.
There are three types of constructors, namely:
1. Default constructor
2. Parameterized constructor
3. Copy constructor

12. What is copy constructor?


Copy constructor is a parameterized constructor using which one object can be copied to
another object.

13. Give difference between default and parameterized constructor.


Default constructor Parameterized constructor
A constructor which doesn’t accept any A constructor which accepts arguments is
arguments is called a default constructor. called a parameterized constructor.
It cannot be overloaded It can be overloaded.
All objects are initialized to same set of Different objects can be initialized to
values. different values.

14. Differentiate between base class and derived class.


Base class Derived class
It is the class whose properties are It is the class that inherits the
inherited by another class. It is also properties from the base class. It is also
called as Super class called as Sub class.

15. What is hierarchical and hybrid inheritance?


Hierarchical Hybrid
When more than one class is derived Hybrid inheritance is a combination of
from a single base class, then that hierarchical and multi-level inheritance
inheritance is called as hierarchical [Hybrid inheritance is combination of
inheritance. two or more types of inheritance.]

2
16. What is a pointer? Mention advantages.
Pointer is a variable which stores the address of another variable.
Advantages:
➢ Proper utilization of memory
➢ Dynamic allocation and de allocation of memory
➢ Easy to deal with hardware components
➢ It is possible to write efficient programs.
➢ Establishes communication between program and data
17. What is the use of * and & operators with respect to pointers.
* is pointer operator.it returns the value of the variable,
& is address operator. It returns memory address of its operand.
18. Define inheritance. Mention types of inheritance.
It is the capability of one class to acquire the properties from another class.
The different types of inheritance are:
• Single Inheritance
• Multi Level Inheritance
• Multiple Inheritance
• Hierarchical Inheritance
• Hybrid Inheritance
19. List the various operations performed on arrays.
The different operations performed on arrays are
1. Traversing
2. Searching
3. Inserting
4. Deleting
5. Sorting
6. Merging
20. What is searching? Mention the types of searching.
The process of finding out the location of the data item in the given collection of data
items is called searching.
Types
➢ Linear search
➢ Binary search

Section-B
SQL
21. What is SQL? Mention one SQL package.
SQL stands for Structured Query Language.
Language used to communicate with RDBMS.
3
Oracle, Sybase, Microsoft SQL Server, Access
22. Mention the logical operators in SQL.
• AND
• OR
• NOT
• ALL
• ANY
• IN
• LIKE
• BETWEEN
• EXISTS
23. What is primary key?
An attribute or Set of attributes which uniquely identify each record in a table.
24. Mention DDL commands used in SQL.
Create
Alter
Drop
[CAD]
25. Differentiate DROP and DELETE commands in SQL
DELETE DROP
DELETE is used to remove tuples or rows DROP is used to remove entire table
from a table.
It is a Data Manipulation Language It is a Data Definition Language (DDL)
(DML) command Command

26. Mention the data types used in SQL.


➢ Int(number)
➢ Float
➢ Date
➢ Char
➢ Varchar
27. Give the command to display all records or details in the table.
To display all records
Select *
From table name;
To display selected records
Select *
From table _name
Where condition;
28. What is the use of keyword distinct?
It returns unique records, eliminating duplicate records.
29. Differentiate between ORDER BY and GROUP BY CLAUSE in SQL
ORDER BY GROUP BY
ORDER BY sorts the data in ascending or The GROUP BY Statement is used to
descending order. arrange identical data into groups with the
help of some functions
GROUP BY will aggregate records by the
specified columns which allows you to

4
perform aggregation functions on non-
grouped columns (such as SUM, COUNT,
AVG, etc).
Group by clause is used to group the
results of a SELECT query based on one or
more columns.

30. What are the various group functions in SQL?


The different group functions are:
✓ count( ) this function returns the number of rows in the table that satisfies the condition
specified in the where condition.
✓ Max() this function used to get the maximum value from a column.
✓ Min( ) this function used to get the minimum value from a column.
✓ Avg() this function is used to get the average value of a numeric column.
✓ Sum( ) this function is used to get the sum of a numeric column

Section-C
HTML
31. What is the use of HTML? List the basic tags.
HTML is used to create web pages.
BASIC TAGS
<html> Defines an HTML document
<head> Defines information about the document
<title> Defines a title for the document
<body>Defines the document's body
<h1> to <h6> Defines HTML headings
<p> Defines a paragraph
<br> Inserts a single line break
32. Differentiate between radio button and check box

Radio button Check box


we can select or mark single option on we can mark or check all the options over
radio button the checkbox
Radio buttons are used for a specific The checkboxes are used for getting
answer. multiple answers.
Radio Button is represented by a circle Check Box is represented a square box
33. Mention the purpose of <tr><th> and <td> tags used in the table.
<tr> =Table row.
It is used to create a row
<th>=table heading
Used for headings. The text will be bold.
<td>=table data
Used to add data to the table.
34. What is XML?
XML stands for eXtensible Markup Language.
It is a markup language for documents containing structured information.
Structured information contains both content (words,pictures etc) and some indication of
what role that content plays.

5
XML is a markup language much like HTML. XML was designed to describe
data. XML tags are not predefined in XML. You must define your own tags.

35. List the formatting tags in HTML.


<font> The <font> tag is used to change the format of the text
on the web page
<b> The <b> tag will bold the text inside the tag.
<i> The <i> tag will italicize the text inside the tag.
<u> The <u> tag will underline the text inside the tag.

Header Tags The header tags <h1>, ... <h6> allows us to place
additional importance on the text within such tags.
<h1> has the largest size, and <h6> the smallest
<center> The <center> tag causes all the text within the tag to
be centered
<p> The <p> tag indicates a new paragraph
<sub> Subscript text
<sup> Superscript text
<mark>
Eg: Output: HTML Marked Formatting
<h2>HTML [text will be highlighted]
<mark>Marked</mark>
Formatting</h2>
36. What is web scripting?
The process of creating and embedding scripts in a web page is known as web
scripting.
37. What is the purpose of anchor tag in HTML?
Anchor tag defines a hyperlink that links one page to another page.
38. What is a frame?
Frames are used to divide the browser window into multiple sections where each
section can load a separate HTML document.
39. What is the use of PHP files?
PHP stands for PHP Hypertext Pre-processor.
It is a server side scripting language.
Suitable for server-side web development.
40. Mention the features of DHTML.

✓ Dynamic content, which allows the user to dynamically change Web page
content.(depending on time and geographical location)
✓ Dynamic positioning of Web page elements.
✓ Dynamic style, which allows the user to change the Web page's color, font, size or
content.
✓ Can be used to create animations, games, applications, provide new ways of navigating
through web sites.

You might also like