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

Associate Software Engineer

Tech Mahindra
upvote
share-icon
3 rounds | 15 Coding problems

Interview preparation journey

expand-icon
Journey
I applied for this role through an Instagram post made by a job posting group. After a few days, I received an email informing me that my resume had been shortlisted. Later, I received another email regarding a written assessment.
Application story
I applied through one of the Instagram posts made by the job postings page. Later, I received emails from the company.
Why selected/rejected for the role?
I was selected for this role because of my confidence and communication skills. The interviewer mainly focused on communication and problem-solving skills.
Preparation
Duration: 1 month
Topics: Data structures, Java , Python, SQL , Communication Skills
Tip
Tip

Tip 1 : Focus on your communication skills.
Tip 2 : Command on any coding language.

Application process
Where: Company Website
Eligibility: No backlogs in B.tech (Salary Package- 3.25LPA)
Resume Tip
Resume tip

Tip 1: Have some projects on resume.
Tip 2: Mention your certifications.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 Minutes
Interview date11 Jul 2024
Coding problem10

It was a MCQ round with questions of aptitude, English vocabulary and coding MCQs.

1. Java Variables

Which of these can not be used for a variable name in Java?
a) identifier
b) keyword
c) identifier & keyword
d) none of the mentioned

Problem approach

Ans :- b) Keyword

2. OOPS

Which of the following is not an OOPS concept in Java?
a) Polymorphism
b) Inheritance
c) Compilation
d) Encapsulation

Problem approach

Ans:- c) Compilation

3. Environment Variables

Which environment variable is used to set java path?
a) JAVA
b) JAVA_HOME
c) CLASSPATH
d) MAVEN_HOME

Problem approach

Ans:- b) JAVA_HOME is used to store a path to the java installation

4. Exceptions

Which exception is thrown when java is out of memory? 
a) MemoryFullException 
b) MemoryOutOfBoundsException 
c) OutOfMemoryError 
d) MemoryError

Problem approach

Ans:- c) OutOfMemoryError

5. Selection Statements

Which of these are selection statements in Java?
a) break
b) continue
c) for()
d) if()

Problem approach

Ans:- d) if()

6. Aptitude

Find the sum two numbers, whose product is 200 and difference is minimum.
a) 30
b) 27
c) 35
d) 33

Problem approach

Ans:- a) 30

7. Code Output MCQ

What is the output of the following code snippet?
int x = 5;
int y = 10;
System.out.println(x + y + "Hello");
a) 15Hello 
b) Hello15 
c) 510Hello 
d) 5Hello10

Problem approach

In Java, when the + operator is used with a combination of numbers and strings, it performs addition for numbers and concatenation for strings. The expression x + y evaluates to 15, and then "Hello" is concatenated to it. Therefore, the final output is a) 15Hello.

8. Code Output

What is the output of the following code snippet?
public class Main{
    public static void main(String []args){
       String str1 = "Hello";
       String str2 = new String("Hello");
       System.out.println(str1 == str2);
    }
}

Problem approach

The == operator compares the object references. In this case, str1 and str2 refer to different objects, even though they contain the same string value. Therefore, the output is false.

9. Code Output MCQ

What is the output of the following code snippet?
int[] arr = {1, 2, 3, 4, 5};
System.out.println(arr.length);
a) 1 
b) 2 
c) 3 
d) 5

Problem approach

The length property of an array in Java returns the number of elements in the array. In this case, the array arr has 5 elements, so the output is d) 5.

10. Code Output

What is the output of the following Java program?
public class Main{
    public static void main(String []args){
       for (int i = 0; i < 5; i++) {
           System.out.print(i + " ");
           if (i == 2)
               break;
       }
    }
}

Problem approach

The for loop iterates from 0 to 4. When i becomes 2, the if condition i == 2 is true, and the break statement is executed, terminating the loop. Therefore, the output is "0 1 2".

02
Round
Medium
Video Call
Duration30 Minutes
Interview date23 Jul 2024
Coding problem4

This round was a technical interview where the interviewer asked questions about java, sql and about projects.

1. Sort Array

Moderate
15m average time
85% success
0/80
Asked in companies
BNY MellonAdobeOracle

Write a program to sort array without the use of a sort function

Problem approach

We can solve it using sorting algorithms like bubble sort, selection sort, insertion sort, merge sort and quick sort.

Try solving now

2. All Prime Numbers less than or equal to N

Moderate
10m average time
90% success
0/80
Asked in companies
Tech MahindraOptumIBM

Write a program to print prime numbers from 1 to 50.

Problem approach

First, take the number 50 as input.
Then use a for loop to iterate the numbers from 1 to 50
Then check for each number to be a prime number. If it is a prime number, print it.

Try solving now

3. Reverse the String

Easy
15m average time
85% success
0/40
Asked in companies
Harman InternationalAmerican ExpressDelhivery

Write a program to reverse string without loop or predefined function(like reverse). 
Like: var name =”shirsh”
after reverse: var name =”hsrihs”

Problem approach

Use XOR for swapping the variable

Try solving now

4. DSA Questions

Asked about database and sql commands.

What’s the difference between CHAR and VARCHAR?

How do you insert data into a MySQL table?

How do you update data in MySQL?

03
Round
Medium
HR Round
Duration30 Minutes
Interview date30 Jul 2024
Coding problem1

This was an HR interview where the interviewer tested my communication skills.

1. HR Questions

What are your strengths and weaknesses?
Location preference?
Favourite subject and why?
Why this company?

Problem approach

Tip 1: Be confident.
Tip 2: Focus on your communication skills.

Here's your problem of the day

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

Skill covered: Programming

Which array operation has O(n) worst-case time complexity?

Choose another skill to practice
Similar interview experiences
company logo
Associate Software Engineer
2 rounds | 3 problems
Interviewed by Tech Mahindra
0 views
1 comments
0 upvotes
company logo
Associate Software Engineer
4 rounds | 4 problems
Interviewed by Tech Mahindra
0 views
2 comments
0 upvotes
company logo
Associate Software Engineer
5 rounds | 4 problems
Interviewed by Tech Mahindra
1326 views
1 comments
0 upvotes
company logo
Associate Software Engineer
5 rounds | 2 problems
Interviewed by Tech Mahindra
683 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Associate Software Engineer
2 rounds | 2 problems
Interviewed by Tata Consultancy Services (TCS)
4588 views
1 comments
0 upvotes
company logo
Associate Software Engineer
3 rounds | 5 problems
Interviewed by Tata Consultancy Services (TCS)
2885 views
2 comments
0 upvotes
company logo
Associate Software Engineer
4 rounds | 5 problems
Interviewed by Accenture
3472 views
0 comments
0 upvotes