i
TCS
Filter interviews by
I was interviewed in Jan 2025.
ArrayList and LinkedList are both classes in Java used to store and manipulate collections of data. ArrayList uses an array to store elements, while LinkedList uses a doubly linked list.
ArrayList is faster for accessing elements by index, while LinkedList is faster for adding or removing elements in the middle of the list.
ArrayList uses more memory as it needs to allocate space for the entire list upfront, while Linked...
Using Java's synchronized keyword for thread synchronization has advantages like simplicity and disadvantages like potential for deadlock. ReentrantLock offers more flexibility and control.
Advantages of synchronized keyword: simplicity, built-in support in Java
Disadvantages of synchronized keyword: potential for deadlock, lack of flexibility
ReentrantLock advantages: more flexibility, ability to try and lock with timeou...
In Java, == compares memory addresses while .equals() compares object contents.
Use == to compare primitive data types and object references.
Use .equals() to compare object contents, such as strings or custom objects.
Improper usage can lead to unexpected results, as == may not always work as expected with objects.
The Java garbage collector automatically manages memory by reclaiming unused objects.
The garbage collector in Java runs in the background, periodically checking for objects that are no longer needed.
There are different types of garbage collection algorithms in Java, such as Serial, Parallel, CMS, G1, and ZGC.
Each algorithm has its own strengths and weaknesses, and is suited for different types of applications and workl
Java 8 introduced features like lambdas and Stream API which have revolutionized the way Java applications are written.
Lambdas allow for more concise and readable code by enabling functional programming paradigms.
Stream API provides a way to process collections of objects in a functional style, allowing for easier parallel processing and improved performance.
Java 8 also introduced default methods in interfaces, allowin...
Checked exceptions are checked at compile time, while unchecked exceptions are not. Proper handling involves either catching or declaring the exception.
Checked exceptions must be either caught or declared in the method signature using the 'throws' keyword.
Unchecked exceptions do not need to be caught or declared, but can still be handled using try-catch blocks.
Examples of checked exceptions include IOException and SQLE...
The Java Memory Model defines how threads interact through memory and how changes made by one thread are visible to others.
Java Memory Model ensures that changes made by one thread are visible to other threads.
It defines the behavior of threads in terms of reading and writing to memory.
Synchronization in Java ensures that only one thread can access a shared resource at a time.
Volatile keyword in Java ensures visibility...
Method overloading involves creating multiple methods in the same class with the same name but different parameters. Method overriding involves creating a new implementation of a method in a subclass.
Method overloading is used to provide different implementations of a method based on the number or type of parameters. Example: public void print(int num) and public void print(String str)
Method overriding is used to provi...
Functional interfaces in Java are interfaces with a single abstract method. They can be used with lambda expressions for functional programming.
Functional interfaces have only one abstract method, but can have multiple default or static methods.
Lambda expressions can be used to implement the single abstract method of a functional interface concisely.
An example of a custom functional interface is 'Calculator' with a sin
Java Stream is a sequence of elements that supports functional-style operations. It differs from Iterator by allowing for more concise and declarative code.
Streams are designed to allow for functional-style operations on collections, such as map, filter, and reduce.
Streams do not store elements, they operate on the source data structure (e.g., List) directly.
Iterators are used to sequentially access elements in a colle...
Immutability in Java means objects cannot be modified after creation. String class achieves immutability by not allowing changes to its value.
String class in Java is immutable because once a String object is created, its value cannot be changed.
Any operation that appears to modify a String actually creates a new String object with the modified value.
Advantages of immutable objects include thread safety, caching, and ea
final, finally, and finalize have different meanings in Java.
final is a keyword used to declare constants, prevent method overriding, and prevent inheritance.
finally is a block used in exception handling to execute code after try-catch block.
finalize is a method used for cleanup operations before an object is garbage collected.
Singleton design pattern ensures a class has only one instance and provides a global point of access to it.
Create a private static instance of the class.
Make the constructor private to prevent instantiation from outside the class.
Provide a public static method to access the instance, creating it if necessary.
Use synchronized keyword or double-checked locking to ensure thread safety.
Java annotations are metadata that provide data about a program but do not affect the program itself. They are used in frameworks like Spring to configure and customize behavior.
Java annotations are used to provide metadata about a program, such as information about classes, methods, or fields.
In frameworks like Spring, annotations are used to configure various aspects of the application, such as dependency injection, ...
Java Streams can handle parallel processing using parallel streams. Pitfalls include increased complexity and potential for race conditions.
Java Streams can be processed in parallel by calling the parallel() method on a stream.
Potential pitfalls of using parallel streams include increased complexity, potential for race conditions, and performance overhead.
To mitigate these pitfalls, ensure that the operations performed...
ArrayList for frequent retrieval, LinkedList for frequent insertions/deletions.
Use ArrayList when frequent retrieval operations are needed, such as searching for specific elements in a list.
Choose LinkedList when frequent insertions/deletions are required, like maintaining a queue or stack.
Consider memory overhead and performance trade-offs when deciding between ArrayList and LinkedList.
ReentrantLock should be used instead of synchronized when more flexibility and control over locking mechanisms are required.
Use ReentrantLock when you need to implement advanced locking mechanisms like tryLock() or lockInterruptibly().
ReentrantLock supports fair locking mechanisms, unlike synchronized.
ReentrantLock allows for explicit unlocking, reducing the chances of human errors.
Synchronized is simpler and preferred
In Java, == checks for reference equality while equals() checks for value equality. Misuse of == can lead to logical errors.
Override equals() when you want to compare the actual content of objects in user-defined classes.
Override hashCode() alongside equals() to ensure consistent behavior in hash-based collections.
Consider implementing Comparable interface for natural ordering of objects.
Garbage collection in Java automatically reclaims memory occupied by unused objects using different GC algorithms.
Force garbage collection in Java using System.gc() or Runtime.gc() methods.
Not recommended to force garbage collection as it can cause performance issues by disrupting the JVM's natural memory management.
Forcing garbage collection can lead to increased CPU usage and potential application slowdowns.
Lambda expressions in Java 8 improve readability and maintainability by allowing concise and functional-style programming.
Lambda expressions reduce boilerplate code by providing a more concise syntax for implementing functional interfaces.
They make code more readable by allowing developers to express actions as methods that can be passed around as arguments.
Lambda expressions enable a more declarative style of programm...
I applied via Campus Placement
Write a Tim Sort in COBOL
Write a merge sort in Hindi
I applied via Job Portal and was interviewed in Jun 2024. There were 3 interview rounds.
Quantitative, Logical Reasoning and Verbal
Given 2 problems - 1 was on recursion, 2 problems were based on taking input and manipulating and printing output.
Reverse a given string
Create an empty string to store the reversed string
Iterate through the original string from end to start and append each character to the new string
Return the reversed string
What people are saying about TCS
I applied via Company Website and was interviewed in Mar 2024. There were 2 interview rounds.
Go through the aptitude topic lessons provided in TCS nqt portal
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 autom...
TCS interview questions for designations
I was interviewed in Jan 2025.
Get interview-ready with Top TCS Interview Questions
I applied via Company Website and was interviewed in Apr 2024. There were 3 interview rounds.
Reasoning and english
Easy to medium dsa questions
I applied via Recruitment Consulltant and was interviewed in May 2024. There were 2 interview rounds.
Work from home - good or bad
Half hour - there 40 questions to answer
I applied via Referral and was interviewed in Dec 2022. There were 11 interview rounds.
Verbal reasoning and analogues
Reasoning trick and Coding decoding
The three or more person meet face to face exchange then ideas and information that called gd
Create separate folder and keep all the materials wherever you receive as part of assignment possible material example data seet and data dictionary
Title of case, introduction, definition, problem analysis, strength, weakness, opportunity, threats, dest solution, conclusion
Group discussion is a collaborative conversation among a group of individuals to exchange ideas, opinions, and perspectives on a specific topic.
Group discussion involves multiple participants who actively contribute to the conversation.
It encourages open communication, active listening, and respectful debate.
The goal is to explore different viewpoints, reach consensus, or gain deeper insights.
Group discussions can be s...
Verbal reasoning and analogues
I applied via Campus Placement and was interviewed in Dec 2023. There were 2 interview rounds.
In depth aptitude and 2 coding ques
Technical,mr,hr all at once.easy level
Some of the top questions asked at the TCS Software Engineer interview for freshers -
The duration of TCS Software Engineer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 21 interviews
5 Interview rounds
based on 1.5k reviews
Rating in categories
System Engineer
1.1L
salaries
| ₹0 L/yr - ₹0 L/yr |
IT Analyst
66.6k
salaries
| ₹0 L/yr - ₹0 L/yr |
AST Consultant
51.5k
salaries
| ₹0 L/yr - ₹0 L/yr |
Assistant System Engineer
29.8k
salaries
| ₹0 L/yr - ₹0 L/yr |
Associate Consultant
29.5k
salaries
| ₹0 L/yr - ₹0 L/yr |
Amazon
Wipro
Infosys
Accenture