Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
732 views
in Interview-Experiences by Expert (34,270 points) | 732 views

1 Answer

0 like 0 dislike

TCS Technical Interview Questions


1) Explain the functionality of linked list.

A linked list consists of two parts: information and the link. In the single connected listening, the beginning of the list is marked by a unique pointer named start. This pointer does point to the first element of the list and the link part of each node consists of an arrow looking to the next node, but the last node of the list has null pointer identifying the previous node. With the help of start pointer, the linked list can be traversed easily.


2) What are the four basic principles of OOPS?

The four basic principles of Object-Oriented Programming System are listed below:

  • Abstraction: Abstraction is a process of hiding the implementation details and showing only functionality to the user. For example, sending SMS where you type the text and send the message. You don't know the internal processing about the message delivery.
  • Abstraction lets you focus on what the object does instead of how it does it.
  • Inheritance: Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object.
  • Encapsulation: Encapsulation in Java is a process of wrapping code and data together into a single unit, for example, a capsule which is mixed of several medicines.
  • Polymorphism: Polymorphism in Java is a concept by which we can perform a single action in different ways. Polymorphism is derived from 2 Greek words: poly and morphs. The word "poly" means many and "morphs" means forms. So polymorphism means many forms.

3) What is inheritance?

In, Object-Oriented Programming, inheritance is a mechanism based on classes.

 

Inheritance refers to inhering the data members and properties of a parent class to a child class. A class which is derived from another level is often called as a sub-class or a child class, and the type from which the child class is obtained is known as super-class or parent class.


4) What is the way of inheriting variable of one class to any other class?

  1. //Base Class  
  2. class A   
  3. {   
  4. public int a;  
  5. }  
  6. //Derived Class  
  7. class B : A  
  8. {  
  9. a=15;  
  10. }  

5) What is Polymorphism?

Polymorphism is a concept in OOPS which means having many forms. In simple words, it means that different actions will be performed in different instances. Polymorphism is of two types:

  1. Method overloading
  2. Operator overloading

6) What are the different types of inheritance?

Types of Inheritance:

  1. Single inheritance
  2. Multiple Inheritance
  3. Multi-level Inheritance
  4. Multi-path Inheritance
  5. Hierarchical Inheritance
  6. 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.


11) Explain about Joins, Views, Normalization, Triggers?

The JOIN keyword is used in an SQL statement to query data from two or more tables, based on a relationship between specific columns in these tables.

 

Tables in a database are often related to each other with keys.

A view is a virtual table. A look contains rows and columns, just like a real table. The fields in a picture are fields from one or more real tables in the database.

You can add SQL functions, WHERE, and JOIN statements to a view and present the data as if the data were coming from one single table.


12) List different advantages of DBMS

Improved data sharing.

The list of several advantages of DataBase Management System:

  • Improved data security.
  • Better data integration.
  • Minimized data inconsistency.
  • Improved data access.
  • Improved decision making.
  • Increased end-user productivity.

13) What is Database Management System?

A DataBase Management System is a software system used for creating and managing databases. DBMS make it possible for the end user to build and maintain databases. DBMS provides an interface between the end user/application and the databases.


14) What is database Schema?

The formal definition of the database schema is a set of formulas (sentences) called integrity constraints imposed on a database.


15) What are the conditional statements?

The conditional statements can alternatively be called as conditional expression also. Conditional comments are the set of rules which were executed if a particular condition is true. It is often referred to an if-then statement because if the state is true, then the statement is executed.


16) What is the difference between the foreign key and reference key?

Reference Key is the primary key that is referenced in the other table (linked via the other tables Foreign Key). Foreign Key is how you connect the second table to the primary tables Primary Key (or Reference Key).

 


17) What is the difference and similarity between C and C++?

C++ has classes whereas C did not have classes.

C does not support function overloading. In C, for input or output, we use functions like gets(), puts(), scanf(), printf(), etc

C does not support exception handling.


18) The structural difference between bitmap and b-tree index?

Btree

It is made of branch nodes and leaf nodes. Branch nodes hold prefix key value along with the link to the leaf node and the leaf nodes contain the indexed value and rowed.

Bitmap

It consists merely of bits for every single distinct value. It uses a string of bits to locate rows in a table quickly. It is used to index low cardinality columns.


19) What is the difference between a Clustered index and non-clustered index?

Clustered Index

  • Only one per table
  • Faster to read than non clustered as data is physically stored in index order

Non-Clustered Index

  • Can be used lot of times per table
  • Quicker for insert and update operations than a clustered index

20) Diffrentiate between socket and session?

Socket is the Combination of IP address and Port Number (in pairs)

The session is a Logical Connectivity between the source and destination.


21) What is an array?

An array is a collection of similar elements. For an array, the necessary condition is that the data type of all the elements in the array must be same. The declaration of an array in C++ is as follows:

int a[10];

This defines an array whose name is a and has ten elements from index 0-9


22) Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions.

  1.  #include<stdio.h>  
  2. #include<conio.h>  
  3. void main()  
  4. {  
  5. int A[10]={'0','1','0','1','0','0','0','1','0','1','0','0'};  
  6. int x=0,y=A.length-1;  
  7. while(x  
  8. x++;  
  9. else if(A[y])  
  10. y--;  
  11. if(A[x] && !A[y])//here we are checking that stating index is having 1 and last index having 0 than swap values  
  12. A[x]=0,A[y]=1;  
  13. }  
  14. getch();  
  15. }  

 

by Expert (34,270 points)