
TCS


200+ TCS Software Engineer Interview Questions and Answers
Q101. Reverse a sentence in java and reverse a word
Answering how to reverse a sentence and a word in Java.
To reverse a sentence, split the sentence into words and then reverse the order of the words.
To reverse a word, convert the word to a character array and then swap the characters from start to end.
Use StringBuilder or StringBuffer for efficient string manipulation.
Example: 'Hello World' -> 'World Hello', 'Java' -> 'avaJ'
Q102. How we build saml trust between sp and idp dsso using iwa agents oidc with multiple grant types
SAML trust between SP and IDP can be built using IWA agents for DSSO and OIDC with multiple grant types.
For SAML trust using IWA agents, the SP and IDP must be in the same Active Directory domain.
For OIDC with multiple grant types, the SP must be registered with the IDP and the grant types must be configured.
Examples of grant types include authorization code, implicit, client credentials, and refresh token.
SAML trust can also be established using certificate-based authenticat...read more
Q103. Give me a real life example for multiple inheritance
Multiple inheritance is when a class inherits from more than one parent class.
A real-life example of multiple inheritance is a class that inherits from both a 'Bird' class and a 'Mammal' class to create a 'Bat' class.
Another example is a 'FlyingVehicle' class that inherits from both a 'Vehicle' class and a 'Bird' class to create a 'Helicopter' class.
Multiple inheritance can lead to the diamond problem, where a class inherits from two classes that have a common ancestor, causi...read more
Q104. What is cloud full form?
Cloud full form is 'Clustered Load- Balanced and On-Demand Computing'.
Cloud is a network of remote servers that store, manage, and process data.
It allows users to access data and applications from anywhere with an internet connection.
Examples of cloud services include Amazon Web Services, Microsoft Azure, and Google Cloud Platform.
Q105. If I assign a project what will you do? Builtin functions in python? What is Scope in python?
Answering questions related to project assignment and Python built-in functions and scope.
I would first clarify the project requirements and scope with the assigner.
I would then create a plan and timeline for completing the project.
I would utilize Python's built-in functions to efficiently and effectively complete the project.
Python's built-in functions include print(), len(), range(), and many more.
Scope in Python refers to the accessibility of variables within a program.
Glo...read more
Q106. What do you understand by oop?
OOP stands for Object-Oriented Programming, a programming paradigm based on the concept of objects.
OOP focuses on creating objects that contain both data and methods to manipulate that data.
Encapsulation, inheritance, and polymorphism are key principles of OOP.
Examples of OOP languages include Java, C++, and Python.
Q107. how to insert null values in database
Null values can be inserted in database by using the keyword NULL or by leaving the field blank.
Use the keyword NULL to insert a null value in a field
Leave the field blank to insert a null value
In SQL, use the IS NULL operator to check for null values
In programming languages, use the null keyword to represent null values
Q108. What is constructor?, and its types
Constructor is a special method that initializes an object when it is created.
Constructors have the same name as the class they belong to.
Types of constructors include default, parameterized, copy, and static.
Default constructor has no parameters and initializes instance variables to default values.
Parameterized constructor takes arguments and initializes instance variables to specified values.
Copy constructor creates a new object by copying the values of an existing object.
S...read more
Q109. Tell me about introduction of python
Python is a high-level programming language known for its simplicity and readability.
Python was created by Guido van Rossum and first released in 1991.
It is an interpreted language, which means it does not need to be compiled before running.
Python has a large standard library and a vast ecosystem of third-party packages.
It supports multiple programming paradigms, including procedural, object-oriented, and functional programming.
Python is widely used in various domains such as...read more
Q110. What are the types of normalization ?
Normalization is a process of organizing data in a database to reduce redundancy and dependency.
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce-Codd Normal Form (BCNF)
Fourth Normal Form (4NF)
Fifth Normal Form (5NF) or Project-Join Normal Form (PJNF)
Normalization helps in improving database performance and reducing data redundancy.
Example: Splitting a customer's name into first name and last name to avoid repeating the customer's name in multiple re...read more
Q111. what is method overloading and method overriding
Method overloading is when multiple methods have the same name but different parameters. Method overriding is when a subclass provides a different implementation of a method that is already defined in its superclass.
Method overloading allows a class to have multiple methods with the same name but different parameters.
Method overriding occurs when a subclass provides a different implementation of a method that is already defined in its superclass.
Method overloading is determin...read more
Q112. Explain Stress vs Strain Curve and Points?
Stress vs Strain Curve describes the relationship between stress and strain in a material.
Stress vs Strain Curve shows how a material deforms under applied stress.
It helps in understanding the mechanical properties of a material.
The curve typically consists of three regions: elastic, plastic, and fracture.
In the elastic region, the material returns to its original shape after the stress is removed.
In the plastic region, the material undergoes permanent deformation.
The fractur...read more
Q113. Is cloud computing secure?
Cloud computing can be secure if proper security measures are implemented.
Cloud computing security depends on various factors such as data encryption, access controls, and network security.
Cloud service providers offer security features like firewalls, intrusion detection systems, and data backup.
Organizations must also ensure secure coding practices and regularly update software to mitigate vulnerabilities.
Examples of secure cloud computing platforms include Amazon Web Servi...read more
Q114. What is the complexity of quicksort?
Quicksort has an average and best-case time complexity of O(n log n) and worst-case of O(n^2).
Quicksort is a divide-and-conquer algorithm that recursively partitions an array into two sub-arrays based on a pivot element.
The average and best-case time complexity is O(n log n) because each partition divides the array into roughly equal halves.
The worst-case time complexity is O(n^2) when the pivot element is the smallest or largest element in the array, resulting in unbalanced ...read more
Q115. Software handling situation what will you do
I would analyze the situation and determine the appropriate course of action to resolve the issue.
Identify the problem and its root cause
Determine the impact of the issue on the system and users
Develop a plan to resolve the issue
Implement the plan and test the solution
Document the issue and solution for future reference
Q116. Your comfortable language is?
My comfortable language is Java.
I have extensive experience in Java programming.
I am familiar with Java frameworks and libraries.
I have worked on various Java projects, including web development and mobile app development.
Q117. You are ECE, why have you chosen software?
I chose software because of my passion for coding and problem-solving, and the endless opportunities for innovation and growth in the field.
Passion for coding and problem-solving
Endless opportunities for innovation and growth
Interest in technology and software development
Ability to work on diverse projects and industries
Q118. What is PLSQL and Explain the Database planning?
PLSQL is a procedural language designed specifically for Oracle Database. Database planning involves designing, implementing, and maintaining a database system.
PLSQL is used to create stored procedures, functions, and triggers in Oracle Database.
Database planning involves identifying the data to be stored, designing the schema, and optimizing performance.
Normalization is an important aspect of database planning to ensure data integrity and reduce redundancy.
Backup and recover...read more
Q119. Write C program for palindrome.
A C program to check if a given string is a palindrome or not.
Read the input string from the user.
Initialize two pointers, one pointing to the start of the string and the other to the end.
Compare the characters at the two pointers and move them towards each other until they meet or cross each other.
If all the characters match, the string is a palindrome. Otherwise, it is not.
Q120. What is cloud computing?
Cloud computing is the delivery of computing services over the internet.
Cloud computing allows users to access and use computing resources on-demand, such as storage, processing power, and software applications.
It eliminates the need for users to own and manage physical infrastructure, as everything is hosted and managed by the cloud service provider.
Examples of cloud computing services include Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform.
Q121. What is ethical hacking?
Ethical hacking is the practice of identifying vulnerabilities in computer systems and networks to improve their security.
Ethical hacking involves authorized attempts to bypass security measures and identify weaknesses in order to protect against malicious attacks.
It is performed by skilled professionals who use the same techniques as malicious hackers, but with the permission of the system owner.
The goal of ethical hacking is to uncover vulnerabilities before they can be exp...read more
Q122. Which library used for encryption?
The library used for encryption depends on the programming language and framework being used.
In Java, the javax.crypto library is commonly used for encryption
In Python, the cryptography library is a popular choice
In .NET, the System.Security.Cryptography namespace provides encryption functionality
OpenSSL is a widely used encryption library for C/C++
Encryption libraries like bcrypt and scrypt are commonly used for password hashing
Q123. what are the datatypes in cpp
The datatypes in C++ include fundamental types (int, float, bool), derived types (arrays, pointers, references), and user-defined types (classes, structures, unions).
Fundamental types: int, float, bool
Derived types: arrays, pointers, references
User-defined types: classes, structures, unions
Q124. How the database works in Unstructured Stack.?
Unstructured Stack does not have a specific database, but can use various databases for storage.
Unstructured Stack is a collection of various technologies and frameworks that can be used together to build applications.
The choice of database depends on the specific needs of the application.
Some popular databases used in Unstructured Stack include MongoDB, Cassandra, and Couchbase.
Data can be stored in a variety of formats, including JSON, XML, and binary data.
Unstructured Stac...read more
Q125. Which is your favourite DSA algorithm?
My favorite DSA algorithm is Dijkstra's algorithm.
Dijkstra's algorithm is used to find the shortest path between nodes in a graph.
It is a popular algorithm for solving the single-source shortest path problem.
The algorithm is commonly used in network routing protocols and GPS systems.
Q126. difference between @controller and @ restcontroller
The @Controller annotation is used for MVC web applications, while @RestController is used for RESTful web services.
The @Controller annotation is used to define a class as a controller in a Spring MVC application.
The @RestController annotation is used to define a class as a RESTful web service controller.
The @RestController annotation is a combination of @Controller and @ResponseBody annotations.
The @Controller annotation returns a view while @RestController returns data in J...read more
Q127. SQL join query write down left join
Left join in SQL combines all rows from left table with matching rows from right table.
Syntax: SELECT column_name(s) FROM table1 LEFT JOIN table2 ON table1.column_name = table2.column_name
Left table's all rows are included in the result set, even if there is no match in the right table.
Example: SELECT customers.name, orders.order_id FROM customers LEFT JOIN orders ON customers.customer_id = orders.customer_id;
Result set will contain all customers and their orders if any, else...read more
Q128. what are constraints? What are OS layers?
Constraints are limitations or restrictions placed on a system or software. OS layers refer to the different levels of an operating system.
Constraints can include limitations on resources such as memory or processing power
Constraints can also refer to design limitations or requirements imposed by stakeholders
OS layers typically include the kernel, device drivers, system libraries, and user interface
Examples of constraints include a maximum file size limit or a minimum support...read more
Q129. Write a function to detect an infinite loop in a program
Function to detect infinite loop in a program
Use a counter to track the number of iterations
Compare the counter value with a threshold to detect infinite loop
Use a timeout mechanism to stop the program if it runs for too long
Q130. What is normalization ?
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalization involves breaking down a database into smaller, more manageable tables.
Each table should have a primary key and only contain data that is related to that key.
Normalization helps to prevent data inconsistencies and anomalies.
There are different levels of normalization, with each level building on the previous one.
Examples of normalization include converti...read more
Q131. What you seeing as future in Cloud?
Cloud will continue to grow and evolve, with increased focus on security, AI/ML, and hybrid/multi-cloud solutions.
Security will remain a top priority, with increased adoption of zero-trust architecture and cloud-native security tools
AI/ML will be integrated into cloud services to enable more intelligent and automated decision-making
Hybrid and multi-cloud solutions will become more prevalent as organizations seek to balance cost, performance, and flexibility
Serverless computin...read more
Q132. What Programming languages are you Proficient
Proficient in Java, Python, and C++
Java
Python
C++
Q133. What is mem mapped functions lambda expressions
Mem mapped functions are functions that are mapped to a memory address for faster access. Lambda expressions are anonymous functions.
Mem mapped functions are used for faster access to frequently used functions.
Lambda expressions are anonymous functions that can be used as arguments or return values.
Combining mem mapped functions with lambda expressions can lead to even faster code execution.
Example: Using a mem mapped function to access a lambda expression that performs a com...read more
Q134. What is C programming?
C programming is a high-level language used for system programming, embedded systems, and game development.
C is a compiled language
It was developed by Dennis Ritchie in 1972
C is used for developing operating systems, device drivers, and firmware
C is known for its efficiency and low-level memory manipulation capabilities
Examples of C-based software include the Linux kernel, MySQL, and Adobe Photoshop
Q135. write a program for squaring two no and add them
A program to square two numbers and add them together.
Prompt the user to enter two numbers
Square each number using the power operator
Add the squared numbers together
Display the result
Q136. difference between abstract class and interface?
Abstract class is a class with implementation while interface is a contract without implementation.
Abstract class can have both abstract and non-abstract methods while interface can only have abstract methods.
A class can implement multiple interfaces but can only inherit from one abstract class.
Abstract class can have constructors while interface cannot.
Abstract class can have access modifiers while interface methods are public by default.
Q137. Which computer language you like most?
I like Python the most.
Python is a versatile and easy-to-learn language.
It has a simple syntax and emphasizes readability.
Python has a vast ecosystem of libraries and frameworks.
It is widely used in various domains like web development, data analysis, and artificial intelligence.
Python's popularity is due to its flexibility and community support.
Q138. What is hacking?
Hacking is the unauthorized access, manipulation, or exploitation of computer systems or networks.
Hacking involves gaining unauthorized access to computer systems or networks.
It can include activities such as stealing sensitive information, disrupting services, or modifying system functionality.
Hackers use various techniques like social engineering, malware, or exploiting software vulnerabilities.
Examples of hacking include phishing attacks, SQL injections, or distributed den...read more
Q139. what is sql? tell about sql join
SQL is a programming language used for managing and manipulating databases. SQL join is used to combine rows from two or more tables based on a related column between them.
SQL is a standard language for accessing and manipulating databases.
SQL join is used to combine rows from two or more tables based on a related column.
Types of SQL joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column;
Q140. universal gates, why it is universal?
Universal gates are capable of performing all logical operations, making them essential building blocks in digital circuits.
Universal gates can be used to implement any other type of logic gate.
The two most common universal gates are NAND and NOR gates.
By combining universal gates in different ways, complex logic functions can be achieved.
Universal gates simplify the design process by reducing the number of different types of gates needed.
Q141. reverese the pin code of your area using jaca
Reverse the pin code of your area using Java.
Convert the pin code to a string.
Use the StringBuilder class to reverse the string.
Convert the reversed string back to an integer.
Q142. What is Data Structure?
Data structure is a way of organizing and storing data in a computer so that it can be accessed and used efficiently.
Data structures are used to manage large amounts of data efficiently.
They can be implemented using arrays, linked lists, trees, graphs, and other techniques.
Examples include stacks, queues, hash tables, and binary search trees.
Choosing the right data structure for a particular problem is important for optimizing performance.
Common operations on data structures ...read more
Q143. Real time use of stack and Queue?
Stack and Queue are used in real-time systems for managing tasks and events.
Stack is used for managing function calls, undo/redo operations, and backtracking.
Queue is used for managing events, scheduling tasks, and buffering data.
Real-time systems use both data structures for managing tasks and events in a time-sensitive manner.
Examples include task scheduling in operating systems, event handling in GUI applications, and data buffering in network protocols.
Q144. How to achieve Lazy Loading in Angular
Lazy loading in Angular is achieved by using loadChildren in the route configuration to load modules on demand.
Use loadChildren in the route configuration to load modules lazily
Split your application into feature modules
Lazy loading helps in reducing the initial bundle size and improving performance
Q145. what is the use of volatile keyword?
Volatile keyword is used in multithreaded programming to indicate that a variable's value can be changed unexpectedly.
Ensures that the variable is always read from and written to the main memory, not from a cache
Useful for variables shared between multiple threads to prevent unexpected behavior
Does not guarantee atomicity or thread safety, additional synchronization may be needed
Q146. What is InteractionMaanger?
InteractionManager is a class in Android that manages the interactions between views and input events.
It is used to handle touch events and gestures in Android applications.
It provides methods to dispatch touch events to the appropriate views.
It can be used to implement custom touch handling logic.
It is part of the Android framework and can be accessed through the View class.
Q147. What is spring framework, decorator pattern etc.
Spring framework is a Java platform that provides comprehensive infrastructure support for developing Java applications.
Spring framework facilitates the development of enterprise applications by providing solutions for dependency injection, aspect-oriented programming, and more.
It promotes good design practices such as loose coupling and separation of concerns.
Decorator pattern is a structural design pattern that allows behavior to be added to individual objects, either stati...read more
Q148. Implement a inorder traveral of binary tree iterative version
Iterative inorder traversal of binary tree
Create an empty stack and initialize current node as root
Push current node to stack and set current = current.left until current is null
If current is null and stack is not empty, pop a node from stack and print it
Set current = popped_node.right and repeat steps 2-4 until stack is empty
Q149. Add number without using third variable?
Add two numbers without using a third variable.
Use the bitwise XOR operator to add the numbers without carrying.
Use the bitwise AND operator to calculate the carry.
Repeat the process until there is no carry left.
Q150. Difference between Football, Volleyball, Baseball
Football, volleyball, and baseball are different sports with distinct rules, equipment, and gameplay.
Football is played with a round ball and primarily involves using feet to kick the ball into the opponent's goal.
Volleyball is played with a ball and involves two teams trying to hit the ball over a net and score points by making it touch the ground on the opponent's side.
Baseball is played with a ball and involves two teams taking turns batting and fielding, aiming to score r...read more
Q151. what is the micro service framework ?
A microservice framework is a software architecture that allows developers to build and deploy small, independent services.
Microservices are small, independent services that work together to form a larger application.
A microservice framework provides tools and libraries to help developers build and deploy microservices.
Examples of microservice frameworks include Spring Boot, Node.js, and Flask.
Q152. One SQL query to find second highest marks
Use a subquery to find the second highest marks in a table
Use a subquery to select all distinct marks
Order the marks in descending order
Select the second highest mark using LIMIT and OFFSET
Q153. write a java program for palindrome integers
A Java program to check if an integer is a palindrome.
Convert the integer to a string.
Reverse the string.
Compare the reversed string with the original string.
Q154. what is a table in SQL
A table in SQL is a collection of related data organized in rows and columns.
Tables are used to store data in a structured way.
Each table has a unique name and consists of columns and rows.
Columns define the type of data that can be stored in them.
Rows represent individual records in the table.
Tables can be queried using SQL commands to retrieve, insert, update or delete data.
Q155. Java coding with for loop and if conditions
Using Java for loop and if conditions to iterate through an array and perform specific actions based on conditions.
Use a for loop to iterate through the array
Use if conditions to check specific conditions and perform actions accordingly
Example: Iterate through an array of numbers and print only even numbers
Q156. What is better static or dynamic call?
It depends on the specific requirements of the software and the trade-offs between performance and flexibility.
Static calls are faster as they are resolved at compile time, while dynamic calls offer more flexibility at runtime.
Static calls are typically used for performance-critical code where the method being called is known at compile time.
Dynamic calls are useful when the method being called is determined at runtime, such as in polymorphism or reflection.
Consider the speci...read more
Q157. What is object in java?
An object in Java is an instance of a class that encapsulates data and behavior.
Objects are created using the 'new' keyword.
They have state (data) and behavior (methods).
Objects can interact with each other through method calls.
Java is an object-oriented programming language, so everything in Java is an object.
Example: 'String' is an object in Java.
Q158. Write C program in java
It is not possible to write a C program in Java as they are two different programming languages.
C and Java are different programming languages with different syntax and features.
C programs use C-specific libraries and functions, while Java programs use Java-specific libraries and functions.
To write a C program, you need to use a C compiler, while to write a Java program, you need a Java compiler.
Q159. Difference between exe and dll?
Exe is an executable file while DLL is a dynamic link library.
Exe is a standalone program while DLL is a library of functions that can be called by multiple programs.
Exe files are loaded into memory when executed while DLL files are loaded only when needed.
Exe files have their own memory space while DLL files share memory space with the calling program.
Exe files can be run independently while DLL files require a calling program.
Examples of exe files include Microsoft Word whi...read more
Q160. Difference between interference and abstract class
Interference is multiple inheritance in Java, while abstract class is a class with abstract methods.
Interference allows a class to inherit from multiple classes, while abstract class can have abstract methods that must be implemented by subclasses.
In Java, a class can implement multiple interfaces (interference), but can only extend one abstract class.
Abstract classes can have non-abstract methods and fields, while interfaces can only have abstract methods and constants.
Q161. what is encapsulation?
Encapsulation is the process of hiding internal details of an object and providing access only through a well-defined interface.
Encapsulation helps in achieving data abstraction and data hiding.
It allows for better control over the data and prevents unauthorized access.
Encapsulation promotes code reusability and modularity.
Example: A class with private variables and public methods to access and modify those variables.
Q162. Why you choose python rather than java
Python's simplicity, readability, and versatility make it a better choice for rapid development and data analysis compared to Java.
Python is known for its simplicity and readability, making it easier to write and maintain code.
Python has a vast ecosystem of libraries and frameworks for various purposes, such as data analysis (e.g. pandas, numpy) and web development (e.g. Django, Flask).
Python's dynamic typing and automatic memory management reduce the amount of code needed, l...read more
Q163. How to optimise a stored procedure
Optimise stored procedure by reducing unnecessary operations and improving query performance.
Identify and remove redundant code
Use appropriate indexing
Minimize network traffic
Avoid using cursors
Use SET-based operations instead of loops
Avoid using temporary tables
Use stored procedure parameters
Use TRY-CATCH blocks for error handling
Q164. What is oops concept in java
OOPs concept in Java refers to Object-Oriented Programming principles that help in creating modular and reusable code.
Encapsulation: Wrapping data and code into a single unit
Inheritance: Creating new classes from existing ones
Polymorphism: Ability of objects to take on multiple forms
Abstraction: Hiding implementation details and showing only necessary information
Q165. What is pointer and explain its types?
A pointer is a variable that stores the memory address of another variable. There are four types of pointers in C/C++.
Pointer to an integer
Pointer to a character
Pointer to a float
Pointer to a double
Q166. properties of polymorphism
Polymorphism is the ability of an object to take on many forms. It allows objects of different classes to be treated as the same type.
Polymorphism allows for code reusability and flexibility.
It enables the use of a single interface to represent different types of objects.
Polymorphism can be achieved through method overriding and method overloading.
Example: A shape class with different subclasses like circle, square, and triangle. They can all be treated as shapes.
Example: A p...read more
Q167. What is knowledge about computer
Knowledge about computer includes understanding hardware, software, programming languages, and operating systems.
Understanding computer hardware components such as CPU, RAM, and hard drive
Knowledge of programming languages such as Java, Python, and C++
Familiarity with operating systems such as Windows, macOS, and Linux
Ability to troubleshoot common computer issues
Understanding of computer networking and security
Q168. Python programming for inheritance
Python supports inheritance through the use of classes and subclasses.
Inheritance allows a subclass to inherit attributes and methods from a parent class.
The subclass can also override or add new attributes and methods.
Python uses the 'super()' function to call methods from the parent class.
Multiple inheritance is also possible in Python.
The '__init__()' method is used to initialize attributes in a class.
Q169. Primary unique and candidate key?
Primary unique key is a key that uniquely identifies a record in a table. Candidate key is a key that can become a primary key.
Primary unique key is used to ensure data integrity and avoid duplicates.
Candidate key is a potential primary key that can be used if the primary key is not suitable.
A table can have multiple candidate keys but only one primary key.
Example: In a table of employees, the employee ID can be a primary unique key while the email address can be a candidate ...read more
Q170. what is the role of modules in angular
Modules in Angular help organize the application into cohesive blocks of functionality.
Modules in Angular help organize the application by grouping related components, directives, pipes, and services together.
They help in managing dependencies between different parts of the application.
Modules can be imported and exported to share functionality across different parts of the application.
Angular modules can be feature modules (containing a specific feature of the application) o...read more
Q171. What is java core Java advanced java sql
Core Java is the basic concepts of Java programming language, Advanced Java covers advanced topics, and SQL is a language used for managing databases.
Core Java includes concepts like OOP, data types, control structures, and exception handling.
Advanced Java covers topics like servlets, JSP, JDBC, and frameworks like Spring and Hibernate.
SQL is used for querying and managing databases, including operations like SELECT, INSERT, UPDATE, and DELETE.
Q172. What's return statement in java
The return statement in Java is used to explicitly return a value from a method.
The return statement is followed by the value that is to be returned from the method.
It can only be used within a method body.
Once a return statement is executed, the control is transferred back to the caller of the method.
Q173. How many types of joins
There are four types of joins: inner, left outer, right outer, and full outer.
Inner join returns only the matching rows from both tables.
Left outer join returns all the rows from the left table and matching rows from the right table.
Right outer join returns all the rows from the right table and matching rows from the left table.
Full outer join returns all the rows from both tables, with NULL values in the columns where there is no match.
Q174. Stack using Linked List code
A stack implemented using a linked list data structure.
Create a Node class with data and next pointer
Create a Stack class with top pointer
Implement push() to add elements to the top of the stack
Implement pop() to remove and return the top element
Implement isEmpty() to check if the stack is empty
Implement peek() to return the top element without removing it
Q175. What is Dynamic Programming?
Dynamic Programming is a method for solving complex problems by breaking them down into simpler subproblems and storing the results.
Involves breaking down a problem into smaller subproblems
Solves each subproblem only once and stores the result for future reference
Uses the results of subproblems to solve the larger problem efficiently
Q176. What is sealed classes in c#
Sealed classes in C# are classes that cannot be inherited or used as a base class.
Sealed classes are used to restrict inheritance for security or design reasons.
They are marked with the 'sealed' keyword.
Example: 'sealed class MyClass { }' prevents other classes from inheriting from MyClass.
Q177. what is the use of treeset
TreeSet is a sorted set implementation in Java that uses a tree structure.
TreeSet maintains elements in sorted order
It does not allow duplicates
It provides efficient operations for adding, removing, and retrieving elements
It is useful in scenarios where elements need to be maintained in a specific order
Q178. what is dictionary in python?
Dictionary is a collection of key-value pairs in Python.
Keys must be unique and immutable.
Values can be of any data type.
Access values using keys.
Add or modify values using keys.
Use dict() constructor or {} to create a dictionary.
Example: {'name': 'John', 'age': 30}
Example: dict(name='John', age=30)
Q179. What is SQL ?
SQL is a programming language used to manage and manipulate relational databases.
SQL stands for Structured Query Language.
It is used to create, modify, and query databases.
SQL is used in various applications such as web development, data analysis, and business intelligence.
Examples of SQL-based databases include MySQL, Oracle, and Microsoft SQL Server.
Q180. Spring life cycle explain it
Spring life cycle refers to the series of steps that occur during the creation and destruction of a Spring bean.
The life cycle includes bean instantiation, initialization, use, and destruction.
During instantiation, the bean is created and its dependencies are injected.
During initialization, any necessary setup is performed, such as calling init methods or setting properties.
During use, the bean is available for use by other components in the application.
During destruction, an...read more
Q181. What is loop? Give an example
A loop is a programming construct that repeats a set of instructions until a certain condition is met.
Loops are used to automate repetitive tasks.
There are three types of loops: for, while, and do-while.
Example: for(int i=0; i<10; i++) { //code to be repeated }
Q182. What is string buffer? What is stream api?
String buffer is a mutable sequence of characters. Stream API is a set of classes for processing sequences of elements.
String buffer allows for efficient manipulation of strings without creating new objects.
Stream API provides a functional approach to processing collections of objects.
String buffer is synchronized while StringBuilder is not.
Stream API supports operations like filter, map, reduce, and collect.
Q183. What are joins write a query
Joins are used to combine rows from two or more tables based on a related column between them.
Use JOIN keyword to combine rows from two or more tables based on a related column
Types of joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column
Q184. Write proper code check error Array pointer
Check for errors in array pointer code
Ensure proper memory allocation for the array pointer
Check for null pointers before accessing array elements
Avoid accessing elements beyond the array bounds
Q185. Diff between Scoped and Transient DI
Scoped DI creates a single instance per scope, while Transient DI creates a new instance every time it is requested.
Scoped DI creates a single instance per scope, while Transient DI creates a new instance every time it is requested.
Scoped DI is useful for sharing a single instance within a scope, like a request or session, while Transient DI is useful for creating new instances each time.
Scoped DI can improve performance by reusing instances, while Transient DI can lead to mo...read more
Q186. Difference between left and right join
Left join returns all records from the left table and the matched records from the right table, while right join returns all records from the right table and the matched records from the left table.
Left join includes all records from the left table, even if there are no matches in the right table.
Right join includes all records from the right table, even if there are no matches in the left table.
Example: If we have a table of employees and a table of departments, a left join ...read more
Q187. what is functional interface
A functional interface is an interface that has only one abstract method.
Functional interfaces are used in lambda expressions and method references.
They can have any number of default or static methods.
Examples include Runnable, Comparator, and Function interfaces.
Functional interfaces can be annotated with @FunctionalInterface to ensure they have only one abstract method.
Q188. What is a string
A string is a sequence of characters, typically used to represent text in programming.
A string is an array of characters.
Strings are enclosed in quotation marks, such as "hello world".
Strings can be concatenated using the + operator, e.g. "hello" + " world".
Strings can be accessed character by character using indexing, e.g. "hello"[0] returns 'h'.
Q189. What is big data
Big data refers to large and complex datasets that cannot be easily managed, processed, or analyzed using traditional methods.
Big data is characterized by the 3Vs: volume, velocity, and variety.
Volume: Big data involves large amounts of data that cannot be handled by traditional databases.
Velocity: Big data is generated and processed at high speeds, requiring real-time or near-real-time analysis.
Variety: Big data includes structured, semi-structured, and unstructured data fro...read more
Q190. what is PHP
PHP is a server-side scripting language used for web development.
PHP stands for Hypertext Preprocessor.
It is widely used for creating dynamic web pages and web applications.
PHP code is embedded within HTML code.
It supports various databases like MySQL, PostgreSQL, etc.
Popular frameworks like Laravel, Symfony, and CodeIgniter are built using PHP.
Q191. How to add a pointer
To add a pointer, declare a pointer variable and assign it the memory address of the variable you want to point to.
Declare a pointer variable using the * operator
Assign the memory address of the variable to the pointer using the & operator
Access the value of the variable using the pointer variable
Example: int num = 5; int *ptr = # printf("%d", *ptr); // Output: 5
Q192. what is java? inheritence
Java inheritance allows one class to inherit attributes and methods from another class.
Inheritance in Java allows for code reusability and promotes the concept of 'is-a' relationship.
Subclass inherits the properties and behaviors of a superclass.
Example: class Car extends Vehicle, where Car is a subclass of Vehicle.
Q193. Difference between thow and throws
In Java, 'throw' is used to throw an exception explicitly, while 'throws' is used in method signature to declare the exceptions that the method may throw.
throw is used to throw an exception explicitly in Java
throws is used in method signature to declare the exceptions that the method may throw
Example: throw new Exception();
Example: public void method() throws Exception {}
Q194. Explain about procedures,packages and triggers?
Procedures, packages, and triggers are database objects used to automate tasks and improve performance.
Procedures are a set of SQL statements that can be executed repeatedly.
Packages are a collection of related procedures, functions, and variables that can be used together.
Triggers are special types of procedures that are automatically executed in response to certain events, such as inserting or updating data in a table.
Procedures and packages can be used to encapsulate compl...read more
Q195. Any idea about overloaded concept
Overloading is the ability to define multiple methods with the same name but different parameters.
Overloading allows a method to perform different tasks based on the input parameters.
The overloaded methods must have different parameter types or number of parameters.
Example: void print(int x), void print(String s), void print(int x, String s)
Overloading is compile-time polymorphism.
Q196. Print Prime number till n numbers
A program to print prime numbers up to n numbers
Iterate through numbers from 2 to n
Check if each number is prime by dividing it by numbers up to its square root
If a number is prime, add it to the list of prime numbers
Q197. What is internet
Internet is a global network of interconnected computers and devices that communicate with each other using standardized protocols.
Internet allows people to access and share information from anywhere in the world
It enables communication through email, messaging, video conferencing, and social media
Online shopping, banking, and entertainment are all made possible by the internet
The internet is made up of servers, routers, and other networking equipment that work together to tr...read more
Q198. What are get set methods
Get set methods are used in object-oriented programming to retrieve and update the values of private variables.
Get methods are used to retrieve the value of a private variable.
Set methods are used to update the value of a private variable.
They are commonly used to ensure data encapsulation and control access to class variables.
Q199. How to model a RDBMS database
Modeling a RDBMS database involves identifying entities, attributes, and relationships and creating tables with appropriate constraints.
Identify entities and their attributes
Determine relationships between entities
Create tables with appropriate constraints
Normalize the database to reduce redundancy
Use primary and foreign keys to enforce referential integrity
Q200. What is inheritance
Inheritance is a mechanism in object-oriented programming where a new class is created by inheriting properties of an existing class.
Inheritance allows code reuse and promotes code organization.
The existing class is called the parent or superclass, and the new class is called the child or subclass.
The child class inherits all the properties and methods of the parent class, and can also add new properties and methods.
For example, a class Animal can be a parent class, and class...read more
More about working at TCS







Top HR Questions asked in TCS Software Engineer
Interview Process at TCS Software Engineer

Top Software Engineer Interview Questions from Similar Companies





