i
Tech Mahindra
Filter interviews by
final is a keyword in Java used to declare constants, while finally is a block used in exception handling to ensure code is executed regardless of an exception.
final keyword is used to declare constants in Java
final variables cannot be reassigned once initialized
finally block is used in exception handling to ensure code is executed regardless of an exception
finally block is often used to release resources like closing
Developed a web application for a financial institution to manage customer accounts and transactions.
Used Java Spring framework for backend development
Implemented RESTful APIs for communication between frontend and backend
Utilized Hibernate for database interaction
Integrated third-party payment gateway for transactions
flatMap in Java 8 is a method used to transform each element of a stream into another stream and then concatenate all the streams into a single stream.
flatMap is used to flatten nested collections in streams.
It is commonly used with streams of collections or arrays.
Example: List> list = Arrays.asList(Arrays.asList(1, 2), Arrays.asList(3, 4)); list.stream().flatMap(Collection::stream).forEach(System.out::println);
I applied via Company Website and was interviewed in Jun 2023. There were 3 interview rounds.
Medium level Strings and Array questions
LCA of a node in BST is the lowest common ancestor of two nodes in a binary search tree.
Traverse the BST from the root node to find the LCA of the given nodes.
Compare the values of the nodes with the current node to determine the LCA.
If one node is on the left subtree and the other is on the right subtree, the current node is the LCA.
Optimize the solution by using efficient data structures and algorithms.
Use HashMap instead of ArrayList for faster lookup
Implement caching to store previously calculated results
Consider using multithreading for parallel processing
What people are saying about Tech Mahindra
I applied via LinkedIn and was interviewed in Feb 2023. There were 2 interview rounds.
HashMap is a data structure that stores key-value pairs and uses hashing to retrieve values.
HashMap uses an array of buckets to store key-value pairs
The hash code of the key is used to determine the index of the bucket
If multiple keys have the same hash code, they are stored in a linked list within the bucket
HashMap allows null keys and values
HashMap is not thread-safe and requires synchronization for concurrent access
Program to print even and odd numbers using two threads in Java
Create two threads, one for even numbers and one for odd numbers
Use a loop to generate numbers and check if they are even or odd
Print the numbers using the respective threads
Use synchronization to ensure alternate printing of even and odd numbers
Tech Mahindra interview questions for designations
I applied via Walk-in and was interviewed before Apr 2021. There was 1 interview round.
Starting as 25,000 in my hands
Get interview-ready with Top Tech Mahindra Interview Questions
posted on 5 Jan 2025
I applied via Naukri.com and was interviewed in Dec 2024. There were 3 interview rounds.
I applied via Walk-in and was interviewed in Nov 2024. There was 1 interview round.
Use Streams to remove duplicates and retain only even numbers from an array.
Convert the array to a stream using Arrays.stream()
Use distinct() to remove duplicates
Filter out odd numbers using filter()
Collect the result using collect(Collectors.toList())
Static methods can be accessed without creating an instance of the class, while final keyword makes the method unchangeable.
Static methods belong to the class itself, not to any specific instance
Final keyword ensures that the method cannot be overridden in subclasses
Static methods are commonly used for utility methods that do not require access to instance variables
Example: Math class in Java has static methods like Ma
The @RestController annotation is used to define RESTful web services while @Controller annotation is used to define MVC controller.
RestController is a specialized version of Controller used for RESTful web services
RestController eliminates the need for @ResponseBody annotation
Controller is used for traditional MVC controller functionality
RestController returns data directly without needing to go through a view resolve...
Microservices are a software development technique where applications are composed of small, independent services that communicate with each other.
Microservices allow for easier scalability and maintenance of complex applications.
Each service in a microservices architecture can be developed, deployed, and scaled independently.
Microservices promote flexibility and agility in software development.
Examples of companies us...
I applied via Company Website and was interviewed in Oct 2024. There were 2 interview rounds.
Memory leaks occur when a program allocates memory but does not release it, leading to inefficient memory usage.
Use tools like profilers to identify memory leaks in Java applications.
Avoid creating unnecessary objects and ensure proper garbage collection.
Avoid static references to objects that can prevent them from being garbage collected.
Close resources like files, database connections, and streams after use to preven
Comparable is an interface used for natural ordering, while Comparator is an interface used for custom ordering.
Comparable is implemented by the class itself to define the natural ordering of objects.
Comparator is implemented by a separate class to define custom ordering of objects.
Example: String class implements Comparable interface for natural ordering, while Collections class uses Comparator for custom sorting.
Interview experience
based on 3 reviews
Rating in categories
Software Engineer
26.4k
salaries
| ₹2 L/yr - ₹9 L/yr |
Senior Software Engineer
21.3k
salaries
| ₹5.5 L/yr - ₹23.1 L/yr |
Technical Lead
11.6k
salaries
| ₹9.2 L/yr - ₹37 L/yr |
Associate Software Engineer
5.5k
salaries
| ₹1.8 L/yr - ₹6 L/yr |
Team Lead
4.9k
salaries
| ₹5.2 L/yr - ₹17 L/yr |
Infosys
Cognizant
Accenture
Wipro