i
TCS
Filter interviews by
Program implementing basic OOP concepts
Create classes with properties and methods
Encapsulate data to restrict access
Inherit properties and methods from parent classes
Polymorphism to allow objects to take on multiple forms
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.
This task involves creating a specific pattern using Java and Python programming languages.
Identify the pattern requirements clearly before coding.
Use nested loops to generate rows and columns for the pattern.
In Java, utilize System.out.println() for output.
In Python, use print() function for displaying the pattern.
Example pattern: For n=5, output could be a triangle or diamond shape.
Routing in ASP.NET MVC maps URLs to controller actions, enabling clean and SEO-friendly URLs.
Routing is defined in the RouteConfig.cs file within the App_Start folder.
Default route: routes.MapRoute(name: 'Default', url: '{controller}/{action}/{id}', defaults: new { controller = 'Home', action = 'Index', id = UrlParameter.Optional });
Custom routes can be added before the default route to prioritize specific pattern...
What people are saying about TCS
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
Promise in Angular is a way to handle asynchronous operations and avoid callback hell.
Promises represent a value that may not be available yet but will be resolved at some point in the future.
They have three states: pending, fulfilled, or rejected.
Promises can be chained using .then() and .catch() methods.
Angular uses promises extensively for HTTP requests and other asynchronous operations.
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.
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
MVC is an architectural pattern used in software development to separate the application into three interconnected components: Model, View, and Controller.
Model represents the data and business logic of the application.
View is responsible for the presentation layer and displaying the data to the user.
Controller acts as an intermediary between the Model and View, handling user input and updating the Model and View ...
Object-Oriented Programming (OOP) is a paradigm based on objects, encapsulating data and behavior for better code organization.
Encapsulation: Bundling data and methods. Example: A class 'Car' with properties like 'color' and methods like 'drive()'.
Inheritance: Deriving new classes from existing ones. Example: 'ElectricCar' inherits from 'Car', adding features like 'charge()'.
Polymorphism: Methods can take many for...
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 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...
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...
Leetcode medium asked. Merging the intervals
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 allow...
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
| ₹3.9 L/yr - ₹8.3 L/yr |
IT Analyst
65.5k
salaries
| ₹7.7 L/yr - ₹12.7 L/yr |
AST Consultant
53.6k
salaries
| ₹12 L/yr - ₹20.6 L/yr |
Assistant System Engineer
33.2k
salaries
| ₹2.5 L/yr - ₹6.4 L/yr |
Associate Consultant
33k
salaries
| ₹16.2 L/yr - ₹28 L/yr |
Amazon
Wipro
Infosys
Accenture