TCS Technical Interview Questions [ Part 2]
Want Previous 5 Questions ? [ Part 1]
6) What are the different types of inheritance?
Types of Inheritance:
- Single inheritance
- Multiple Inheritance
- Multi-level Inheritance
- Multi-path Inheritance
- Hierarchical Inheritance
- Hybrid Inheritance
7) What is the difference between classes and interface?
The differences between classes and interfaces are listed below:
- A class can be instantiated by creating its object, whereas interfaces cannot be instantiated as all the methods in the interface are abstract and do not perform any action, so there is no use of instantiating an interface.
- A class is declared using class keyword whereas an interface is declared using interface keyword.
- The members of the class can have access specifier such as public, protected, and private but members of the interface can not have the access specifier, all the members of the interface is declared as public because the interface is used to derive another class. There will be no use to access specifies inside the members of an interface.
- The methods inside the class are defined to perform some actions on the fields declared in the class whereas interface lacks in asserting in areas, the ways in an interface are purely abstract.
- A class can implement any number of the interface but can only extend one superclass. Whereas interface can reach any number of interfaces but cannot perform any interface.
- A class can have a constructor defined inside the class to declare the fields inside the class, whereas interface doesn't have any constructor defined because there are no fields to be initialized.
8) What is software development life-cycle?
Software development life-cycle is steps involved in the life cycle of software development phase. Generally, it is followed by the development team which develops the software in the organization. It consists of a clear explanation of developing and maintaining the software.
=========================================================================
9) What is normalization of databases, joins, and keys?
Normalization is process of organizing data in a database efficiently. Two goals of the normalization process are: to eliminate redundant data (for example, storing the same data in more than one table) and also ensure data dependencies make sense (only storing related data in a table). These both are important as they reduce the amount of space a database consumes and ensure that data is logically stored.
10) What are loops?
Loops are used to execute block of statement several times in a program depending upon the conditional statement. The basic structure of a circuit is given above in the diagram. For each successful execution of the loop, the conditional statement should be checked. If the conditional statement is true, then the circuit will be executed. If the conditional statement is false, then the course will be terminated.