Tech Mahindra interview experience Real time questions & tips from candidates to crack your interview

Software Engineer

Tech Mahindra
upvote
share-icon
4 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 Months
Topics: Data Structure, Core Java, Design Pattern, Spring Boot, GitHub, Oops Concept.
Tip
Tip

Tip 1 : Should know about everything you write in resume & well prepare.
Tip 2 : Solving problems as much as possible and participate in competitive programming contests.
Tip 3 : To know implementation of complex code and must write and should know the internal implementation of data structure you use while coding.
Tip 4 : To solve logical problems and will to learn new technologies.

Application process
Where: Other
Eligibility: 60%
Resume Tip
Resume tip

Tip 1 : Must have project described at least 2-3 project for good impression
Tip 2 : To be honest about what you write in resume.
Tip 3 : Able to explain each things in shorted way.
Tip 4 : if you have good score in live coding challenge share the score and certification.

Interview rounds

01
Round
Medium
Telephonic
Duration50 minutes
Interview date31 Jul 2021
Coding problem2

1. Can you tell how linear data structures differ from non-linear data structures?
2. What is the time complexity of basic operations get() and put() in HashMap class?
3. Which data structures are used for implementing LRU cache?
4. Explain recursive function to calculate the height of a binary tree in Java.
5. How do you implement stack using queues?
6. What is a doubly-linked list (DLL)? What are its applications.

1. Move Zeros To Left

Easy
10m average time
90% success
0/40
Asked in companies
AdobeTech MahindraDell Technologies

You are given an array 'ARR' of integers. Your task is to modify the array so that all the array elements having zero values get pushed to the left and all the array elements having non-zero value come after them while maintaining their relative order.

For example :
Consider the array { 1, 1, 0, 2, 0 }. 
For the given array the modified array should be {0,0,1,1,2} . 
Arrays { 0, 0, 1, 2, 1 } and  { 0, 0, 2, 1, 1 } are not the correctly reorganized array even if they have all the zero values pushed to the left as in both the arrays the relative order of non-zero elements is not maintained.
Follow Up :
Can you solve the problem in linear time, and constant space?
Problem approach

Step 1: Split the given inputString into words using split() method.
Step 2: Then take each individual word, reverse it and append to reverseString.
Step 3: print reverseString.

public class ReverseEachWord
{
static void reverseEachWordOfString(String inputString)
{
String[] words = inputString.split(" ");

String reverseString = "";

for (int i = 0; i < words.length; i++) 
{
String word = words[i];

String reverseWord = "";

for (int j = word.length()-1; j >= 0; j--) 
{
reverseWord = reverseWord + word.charAt(j);
}

reverseString = reverseString + reverseWord + " ";
}

System.out.println(inputString);

System.out.println(reverseString);

System.out.println("-------------------------");
}

public static void main(String[] args) 
{
reverseEachWordOfString("Java Concept Of The Day");

reverseEachWordOfString("Java J2EE JSP Servlets Hibernate Struts");

reverseEachWordOfString("I am string not reversed");

reverseEachWordOfString("Reverse Me");
}
}

Try solving now

2. Frequency In A Sorted Array

Easy
15m average time
85% success
0/40
Asked in companies
SliceUrban Company (UrbanClap)Tech Mahindra

You are given a sorted array 'ARR' and a number 'X'. Your task is to count the number of occurrences of 'X' in 'ARR'.

Note :
1. If 'X' is not found in the array, return 0.
2. The given array is sorted in non-decreasing order.
Problem approach

Step 1 : Create one HashMap object called elementCountMap with elements of inputArray as keys and their occurrences as values.

Step 2 : Check every element of inputArray for its presence in elementCountMap.

Step 3 : If an element is already present in elementCountMap, increment it’s count by 1.

elementCountMap.put(i, elementCountMap.get(i)+1);

Step 4 : If an element is not present in elementCountMap, add this element to elementCountMap with 1 as it’s value.

elementCountMap.put(i, 1);

Step 5 : Print elementCountMap. This will contain all the elements of inputArray along with their occurrences.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date2 Aug 2021
Coding problem1

Started with full Introduction, asking about last company experience & experties with Skills set. Explain give live project working. Roles & responsible with previous organisation. Based on resume they are asked questions

1. First non repeating character

Easy
15m average time
80% success
0/40
Asked in companies
FlipkartQuikrHCL Technologies

Ninja is now bored with numbers and is now playing with characters but hates when he gets repeated characters. Ninja is provided a string, and he wants to return the first unique character in the string.The string will contain characters only from the English alphabet set, i.e., ('A' - 'Z') and ('a' - 'z'). If there is no non-repeating character, print the first character of the string. If there is no non-repeating character, return the first character of the string.

Problem approach

Step 1 : Define one HashMap called charCountMap with Character as key and Integer as value. This map will hold the characters and their count in the given string.

Step 2 : Convert inputString to char array called strArray.
Step 3 : Iterate through all chars of strArray and update their occurrences in charCountMap.

Step 4 : Iterate through all chars of strArray and check their count in charCountMap. Any first occurring character with 1 as it’s count will be the first non-repeated character in input String.

Step 5 : Iterate through all chars of strArray and check their count in charCountMap. Any first occurring character with >1 as it’s count will be the first repeated character in inputString.

Try solving now
03
Round
Medium
HR Round
Duration50 minutes
Interview date3 Aug 2021
Coding problem1

OOPS Concept,
C and Java Difference,
DBMS, Data Structure
Java 8 features
Design patterns
Spring Boot

1. Standard HR Question

How to find trigonometric values of an angle in java?


 

Problem approach

Tip 1 : sine of an angle —> Math.sin();
Tip 2 : cosine of an angle —> Math.cos();
Tip 3 : tangent of an angle —> Math.tan();
Tip 4 : sec of an angle —> 1/Math.sin();
Tip 5 : cosec of an angle —> 1/Math.cos();
Tip 6 : cot of an angle —> 1/Math.tan();

04
Round
Medium
HR Round
Duration30 minutes
Interview date5 Aug 2021
Coding problem1

Asking about experience & roles responsible with previous organisations
Introduction about your self
Why we hire you ?
Current CTC & Expected CTC

1. Basic HR Questions

Why you are fit for the position?

How can you support us?

Problem approach

Tip 1 : Give them appropriate answer also showing them interested to join organisation 
Tip 2 : Fit for the position because I have that much of skills & expertise

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is 3 + 2 * 4 based on operator precedence?

Choose another skill to practice
Similar interview experiences
company logo
Software Engineer
2 rounds | 2 problems
Interviewed by Tech Mahindra
0 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 4 problems
Interviewed by Tech Mahindra
0 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 2 problems
Interviewed by Tech Mahindra
2058 views
1 comments
0 upvotes
company logo
Software Engineer
2 rounds | 2 problems
Interviewed by Tech Mahindra
1280 views
1 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Engineer
4 rounds | 1 problems
Interviewed by Newgen Software
2695 views
2 comments
0 upvotes
company logo
Software Engineer
3 rounds | 6 problems
Interviewed by HashedIn
2041 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 2 problems
Interviewed by Ernst & Young (EY)
0 views
0 comments
0 upvotes