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 clo...
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<Integer>> list = Arrays.asList(Arrays.asList(1, 2), Arrays.asList(3, 4)); list.stream().flatMap(Collection::stream).forEach...
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
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.
What people are saying about Tech Mahindra
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 a...
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
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<Integer>> list = Arrays.asList(Arrays.asList(1, 2), Arrays.asList(3, 4)); list.stream().flatMap(Collection::stream).forEach(Syst...
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
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
I applied via Walk-in and was interviewed before Apr 2021. There was 1 interview round.
Starting as 25,000 in my hands
I applied via LinkedIn and was interviewed in Nov 2021. There was 1 interview round.
Generics in Java allow for type safety and reusability of code.
Generics allow for the creation of classes, interfaces, and methods that can work with any data type.
They provide compile-time type safety, preventing runtime errors.
Examples include ArrayList
Wildcards can be used to allow for flexibility in generic types.
Generics can improve code readability and reduce the need for casting.
Ge...
I applied via Referral and was interviewed in Sep 2021. There were 6 interview rounds.
Reliability refers to the ability of a system or component to perform its required functions under stated conditions for a specified period of time.
Reliability is a measure of how often a system or component fails and how quickly it can be restored to normal operation.
It is important to design systems with redundancy and failover mechanisms to ensure high reliability.
Reliability can be improved through regular maintena...
I applied via Recruitment Consultant and was interviewed before Oct 2020. There was 1 interview round.
based on 4 interview experiences
Difficulty level
Duration
based on 3 reviews
Rating in categories
Hyderabad / Secunderabad,
Bangalore / Bengaluru
+17-12 Yrs
Not Disclosed
Software Engineer
26.6k
salaries
| ₹3.7 L/yr - ₹9.3 L/yr |
Senior Software Engineer
22.2k
salaries
| ₹9.1 L/yr - ₹18.5 L/yr |
Technical Lead
12.5k
salaries
| ₹16.9 L/yr - ₹30 L/yr |
Associate Software Engineer
6.1k
salaries
| ₹1.9 L/yr - ₹5.6 L/yr |
Team Lead
5.4k
salaries
| ₹5.7 L/yr - ₹17.8 L/yr |
Infosys
Cognizant
Accenture
Wipro