i
TCS
Filter interviews by
SOLID principles are five design principles aimed at making software designs more understandable, flexible, and maintainable.
Single Responsibility Principle (SRP): A class should have only one reason to change, meaning it should only have one job. For example, a class handling user data should not also handle user authentication.
Open/Closed Principle (OCP): Software entities should be open for extension but closed...
A datatype is a classification that specifies the type of data a variable can hold in programming.
Datatypes define the operations that can be performed on data.
Common datatypes include: int (integer), float (floating-point), char (character), and string (text).
In Python, examples are: int (5), float (3.14), str ('Hello').
Datatypes can be categorized into primitive (e.g., int, char) and composite (e.g., arrays, obj...
This code checks for prime numbers within a given range and prints them out.
A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers.
Examples of prime numbers include 2, 3, 5, 7, 11, and 13.
To check if a number is prime, test divisibility from 2 up to the square root of the number.
If a number is divisible by any of these, it is not prime; otherwise, it is p...
The pillars of OOP are encapsulation, inheritance, polymorphism, and abstraction, forming the foundation of object-oriented design.
Encapsulation: Bundling data and methods that operate on the data within a single unit (class). Example: A 'Car' class with properties like 'speed' and methods like 'accelerate()'.
Inheritance: Mechanism to create a new class from an existing class, inheriting its attributes and behavio...
What people are saying about TCS
CompletableFuture is a Java class that represents a future result of an asynchronous computation.
Supports non-blocking asynchronous programming.
Can be completed manually using complete() method.
Allows chaining of multiple asynchronous tasks using thenApply(), thenAccept(), etc.
Example: CompletableFuture.supplyAsync(() -> { return 42; }).thenApply(result -> result * 2);
Handles exceptions with exceptionally() ...
I utilized threads to enhance performance and responsiveness in my project, allowing concurrent execution of tasks.
Implemented multithreading to handle multiple user requests simultaneously, improving application responsiveness.
Used thread pools to manage a fixed number of threads, reducing overhead and improving resource utilization.
Implemented background tasks using threads for data processing, allowing the main...
Optimize Angular apps by using lazy loading, change detection strategies, and efficient data handling.
Implement Lazy Loading: Load feature modules only when needed to reduce initial load time.
Use OnPush Change Detection: Optimize performance by checking for changes only when input properties change.
Utilize TrackBy in ngFor: Improve rendering performance by tracking items in lists, reducing DOM manipulations.
Avoid ...
ArrayList is preferred for frequent retrieval operations due to fast random access, while LinkedList is suitable for frequent insertions/deletions.
Use ArrayList when frequent retrieval operations are required, such as searching for elements in a large collection.
Choose LinkedList when frequent insertions/deletions are needed, like maintaining a queue or stack.
Consider memory overhead and performance trade-offs whe...
Java Streams handle parallel processing by dividing data into multiple threads using the ForkJoin framework. Pitfalls include race conditions, performance issues with small datasets, and debugging challenges.
Parallel streams use ForkJoin framework for internal parallel execution
Useful for CPU-intensive tasks but may not improve performance for small datasets
Shared mutable state can cause race conditions
Order-sensi...
Immutability in Java prevents objects from being changed after creation, promoting thread safety and preventing unintended side effects.
Immutable objects cannot be modified after creation, promoting thread safety
String class in Java is immutable, modifications create new objects
Use final fields and avoid setters to create immutable classes
Collections can be made immutable using Collections.unmodifiableList()
Immuta...
I appeared for an interview in Jan 2025, where I was asked the following questions.
ArrayList is preferred for frequent retrieval operations due to fast random access, while LinkedList is suitable for frequent insertions/deletions.
Use ArrayList when frequent retrieval operations are required, such as searching for elements in a large collection.
Choose LinkedList when frequent insertions/deletions are needed, like maintaining a queue or stack.
Consider memory overhead and performance trade-offs when dec...
ReentrantLock should be used instead of synchronized when more flexibility and control over locking mechanisms is needed.
Use ReentrantLock when you need to implement advanced locking mechanisms such as tryLock() or lockInterruptibly().
ReentrantLock is preferred when fair locking is required, as it supports fair locking mechanisms.
Consider using ReentrantLock when you want to avoid potential deadlocks or starvation situ...
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() method alongside equals() to ensure proper functioning in collections like HashMap.
Implement Comparable interface and override compareTo() method 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 and disrupt the JVM's natural memory management.
Forcing garbage collection can lead to unnecessary CPU usage and potential application slowdowns.
Lambda expressions in Java 8 improve readability and maintainability by enabling concise and functional-style programming.
Lambda expressions allow writing more compact code by reducing boilerplate code.
They enable passing behavior as arguments to methods, making code more modular and flexible.
Example: (a, b) -> a + b can be used to define a simple addition operation.
They promote functional programming paradigms, lea...
Checked exceptions must be handled explicitly, while unchecked exceptions do not require explicit handling.
Custom exceptions should be used to represent specific error conditions in your application.
Custom exceptions can be either checked or unchecked, depending on whether you want to enforce handling or not.
Examples of custom checked exceptions could include InvalidInputException or DuplicateRecordException.
Examples o...
The Java Memory Model defines how threads interact with shared memory, ensuring visibility and ordering of variable updates in a concurrent environment.
Volatile keyword ensures changes to a variable are always visible to all threads.
Synchronized keyword provides mutual exclusion and visibility guarantees.
Reordering optimizations by compiler or CPU can lead to unexpected behavior.
Happens-before relationship determines o...
Method overloading allows multiple methods with the same name but different parameters, while method overriding allows a subclass to provide a different implementation of a parent method.
Use method overloading when you want to provide multiple ways to call a method with different parameters.
Use method overriding when you want to provide a specific implementation of a method in a subclass.
Example of method overloading: ...
Functional interfaces in Java have exactly one abstract method and work with lambda expressions for concise implementation.
Functional interfaces have exactly one abstract method, making them suitable for lambda expressions.
Examples of functional interfaces in Java include Runnable, Callable, Predicate, and Function.
Default methods in interfaces allow for evolving APIs without breaking backward compatibility.
Method refe...
Java Streams enable functional-style operations on collections with lazy evaluation, unlike Iterators.
Parallel streams can improve performance by utilizing multiple threads, but may introduce overhead due to thread synchronization.
Care must be taken to ensure thread safety when using parallel streams in a multi-threaded environment.
Parallel streams are suitable for operations that can be easily parallelized, such as ma...
final, finally, and finalize have different meanings in Java. final is for constants, finally is for cleanup actions, and finalize is for garbage collection.
final is used to declare constants, prevent method overriding, or inheritance
finally block executes after try-catch for cleanup actions
finalize() method is called by garbage collector before object deletion
Alternatives to finalize() for resource management include ...
Singleton design pattern ensures only one instance of a class exists in the JVM, useful for managing shared resources like database connections.
Avoid using Singleton when multiple instances of a class are required.
Avoid Singleton for classes that are not thread-safe.
Avoid Singleton for classes that need to be easily mockable in unit tests.
Java annotations provide metadata to classes, methods, and fields, improving readability and maintainability of code.
Annotations like @Override, @Deprecated, and @SuppressWarnings provide information about the code to developers and tools.
Frameworks like Spring use annotations such as @Component, @Service, and @Autowired for dependency injection, reducing the need for XML configurations.
Custom annotations can be create...
I appeared for an interview in Jan 2025, where I was asked the following questions.
ArrayList is preferred for frequent retrieval operations due to fast random access, while LinkedList is suitable for frequent insertions/deletions.
Use ArrayList when frequent retrieval operations are required, such as searching for elements in a large collection.
Choose LinkedList when frequent insertions/deletions are needed, like maintaining a queue or stack.
Consider memory overhead and performance trade-offs when dec...
ReentrantLock should be used instead of synchronized when more flexibility and control over locking mechanisms is needed.
Use ReentrantLock when you need to implement custom locking strategies or require advanced features like tryLock() and lockInterruptibly().
ReentrantLock supports fair locking mechanisms, ensuring that threads acquire the lock in the order they requested it.
Explicit unlocking in ReentrantLock reduces ...
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 values of objects instead of their references
Override hashCode() alongside equals() to ensure proper functioning in collections like HashMap
Consider implementing Comparable interface for natural ordering in collections
Garbage collection in Java automatically reclaims memory occupied by unused objects using different algorithms and memory regions.
Java garbage collector automatically reclaims memory from unused objects
Different types of GC algorithms in JVM: Serial, Parallel, CMS, G1 GC
Objects managed in Young Generation, Old Generation, and PermGen/Metaspace
Minor GC cleans up short-lived objects in Young Generation
Major GC (Full GC) ...
Lambda expressions in Java 8 improve readability and maintainability by enabling concise and functional-style programming.
Lambda expressions allow writing more compact code by reducing boilerplate code.
They enable passing behavior as arguments to methods, making code more modular and flexible.
Example: (a, b) -> a + b is a lambda expression that adds two numbers.
Checked exceptions must be handled explicitly, while unchecked exceptions do not require explicit handling.
Use custom exceptions when you want to create your own exception types to handle specific scenarios.
Custom exceptions can be either checked or unchecked, depending on whether you want to enforce handling or not.
For example, a custom InvalidInputException could be a checked exception if you want to ensure it is cau...
The Java Memory Model defines how threads interact with shared memory, ensuring visibility and ordering of variable updates in a concurrent environment.
Volatile keyword ensures changes to a variable are always visible to all threads.
Synchronized keyword provides mutual exclusion and visibility guarantees.
Reordering optimizations by the compiler or CPU can lead to unexpected behavior.
Happens-before relationship determin...
Method overloading allows multiple methods with the same name but different parameters, while method overriding allows a subclass to provide a different implementation of a parent method.
Use method overloading when you want to provide multiple ways to call a method with different parameters.
Use method overriding when you want to provide a specific implementation of a method in a subclass.
Example of method overloading: ...
Functional interfaces in Java have exactly one abstract method and work with lambda expressions for concise implementation.
Functional interfaces have exactly one abstract method, such as Runnable, Callable, Predicate, and Function.
Lambda expressions provide a concise way to implement functional interfaces.
Default methods in interfaces help in evolving APIs without breaking backward compatibility.
Method references (::) ...
Java Streams enable functional-style operations on collections with lazy evaluation, unlike Iterators.
Parallel streams can improve performance by utilizing multiple threads, but may introduce overhead due to thread management.
Care must be taken to ensure thread safety when using parallel streams in a multi-threaded environment.
Parallel streams are suitable for operations that can be easily parallelized, such as map and...
final, finally, and finalize have different meanings in Java. final is for constants, finally for cleanup, and finalize for garbage collection.
final is used for constants, preventing method overriding, and inheritance
finally is used for cleanup actions after a try-catch block
finalize() is called by the garbage collector before object deletion
Alternatives to finalize() for resource management include using try-with-reso...
Singleton design pattern ensures only one instance of a class exists in the JVM, useful for managing shared resources like database connections.
Avoid using Singleton when multiple instances of a class are required.
Avoid Singleton for classes that are not thread-safe.
Avoid Singleton for classes that need to be easily mockable for testing purposes.
Java annotations provide metadata to classes, methods, and fields, improving code readability and maintainability.
Annotations like @Component, @Service, and @Autowired in Spring help with dependency injection
Annotations reduce boilerplate code compared to XML configurations
Custom annotations can be created using @interface
Reflection APIs allow reading annotation metadata dynamically
Annotations like @Transactional simpl...
Java Streams handle parallel processing by dividing data into multiple threads using the ForkJoin framework. Pitfalls include race conditions, performance issues with small datasets, and debugging challenges.
Parallel streams divide data into multiple threads for faster processing
ForkJoin framework handles parallel execution internally
Useful for CPU-intensive tasks but may not improve performance for small datasets
Share...
I appeared for an interview in May 2025, where I was asked the following questions.
DevOps is a set of practices that combines software development and IT operations to enhance collaboration and productivity.
Focuses on collaboration between development and operations teams.
Utilizes automation tools like Jenkins for continuous integration and deployment.
Emphasizes monitoring and feedback loops to improve software quality.
Encourages a culture of shared responsibility for software delivery.
Examples inclu...
GenAI refers to Generative AI, a technology that creates content like text, images, and music using machine learning models.
Generative AI models, like GPT-3, can generate human-like text based on prompts.
DALL-E is an example of Generative AI that creates images from textual descriptions.
Generative AI can be used in various fields, including art, music, and gaming.
It leverages deep learning techniques to understand and ...
Normal aptitude questions were there you can solve previous year questions to have a greater idea
I am proficient in Java, Python, and C++.
Java
Python
C++
I applied via Campus Placement and was interviewed in Nov 2024. There were 3 interview rounds.
Aptitude round
English exam
Maths tricky questions exam
Coding 1 easy 1 tuff
Some disadvantages of my projects include scalability issues, lack of documentation, and limited testing.
Scalability issues: The project was not designed to handle a large amount of data or users, leading to performance issues.
Lack of documentation: There was insufficient documentation on the codebase, making it difficult for new team members to onboard or for future maintenance.
Limited testing: Due to time constraints...
Yes, I am okay with night shifts as I am comfortable working during those hours.
I have previous experience working night shifts in my previous job.
I am a night owl and tend to be more productive during late hours.
I understand the importance of round-the-clock support in the software industry.
Yes, I am okay with reallocation as it is a common practice in the software engineering field.
I am comfortable with reallocation as it is a common practice in software development.
I understand that reallocation may be necessary for project requirements or team dynamics.
I am adaptable and willing to take on new challenges that may come with reallocation.
I applied via Job Portal and was interviewed in Nov 2024. There was 1 interview round.
OOP in Java includes concepts like encapsulation, inheritance, polymorphism, and abstraction for better code organization.
Encapsulation: Bundling data and methods. Example: class with private variables and public getters/setters.
Inheritance: Mechanism to create new classes from existing ones. Example: class Dog extends Animal.
Polymorphism: Ability to take many forms. Example: method overriding and method overloading.
Ab...
TCS NQT exam -> Out of 2 coding questions I did one and matched all test cases. I also solve aptitude, verbal and logical questions
Python is a versatile, easy-to-learn programming language favored for its readability and extensive libraries.
Easy to Learn: Python's syntax is clear and intuitive, making it accessible for beginners. For example, 'print("Hello, World!")' is straightforward.
Versatile: Python can be used for web development, data analysis, artificial intelligence, and more. Frameworks like Django and Flask support web apps.
Rich Librarie...
Some of the top questions asked at the TCS Software Engineer interview -
The duration of TCS Software Engineer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 294 interview experiences
Difficulty level
Duration
based on 1.6k reviews
Rating in categories
System Engineer
1.1L
salaries
| ₹1 L/yr - ₹9 L/yr |
IT Analyst
65.6k
salaries
| ₹7.7 L/yr - ₹12.6 L/yr |
AST Consultant
53.4k
salaries
| ₹12 L/yr - ₹20.5 L/yr |
Assistant System Engineer
33.2k
salaries
| ₹2.6 L/yr - ₹6.4 L/yr |
Associate Consultant
32.8k
salaries
| ₹16.2 L/yr - ₹28 L/yr |
Amazon
Wipro
Infosys
Accenture