Upload Button Icon Add office photos
Engaged Employer

i

This company page is being actively managed by Tech Mahindra Team. If you also belong to the team, you can get access from here

Tech Mahindra Verified Tick

Compare button icon Compare button icon Compare

Filter interviews by

Tech Mahindra Senior Java Developer Interview Questions and Answers

Updated 10 Sep 2024

6 Interview questions

A Senior Java Developer was asked 9mo ago
Q. What is the difference between final and finally?
Ans. 

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...

A Senior Java Developer was asked 9mo ago
Q. What is flatMap in Java 8?
Ans. 

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...

Senior Java Developer Interview Questions Asked at Other Companies

asked in Amdocs
Q1. Remove the Kth Node from the End of a Linked List You are given a ... read more
asked in Amdocs
Q2. Intersection of Linked List Problem You are provided with two sin ... read more
asked in Amdocs
Q3. Merge Two Sorted Linked Lists Problem Statement You are provided ... read more
asked in Amdocs
Q4. LRU Cache Design Question Design a data structure for a Least Rec ... read more
asked in Caspex Corp
Q5. How would you configure Jenkins or GitLab's CICD pipelines to tri ... read more
A Senior Java Developer was asked
Q. How would you optimize the above solution?
Ans. 

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

A Senior Java Developer was asked
Q. Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.
Ans. 

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

View All
a senior engineer
2w
💼 OFFER RECEIVED – Sr. Test Engineer (Band U3) | Tech Mahindra | Noida 📎 Screenshot attached | CTC: ₹13.5 LPA
✅ Variable is paid monthly and fully (as confirmed by HR) ❓ Looking to know the MONTHLY IN-HAND SALARY after standard deductions & partial FBP usage Would appreciate any insights from current/ex-TechM folks! 🙏
FeedCard Image
Got a question about Tech Mahindra?
Ask anonymously on communities.
A Senior Java Developer was asked
Q. In Java, how does a HashMap work internally?
Ans. 

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...

A Senior Java Developer was asked
Q. Write a Java program to print even numbers using one thread and odd numbers using another thread.
Ans. 

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 Senior Java Developer Interview Experiences

5 interviews found

Senior Java Developer Interview Questions & Answers

user image Abhishek Tamakuwala

posted on 10 Sep 2024

Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Technical 

(2 Questions)

  • Q1. What is final and finally
  • Ans. 

    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 ...

  • Answered by AI
  • Q2. Brief description about the last project
  • Ans. 

    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

  • Answered by AI

Skills evaluated in this interview

Interview experience
3
Average
Difficulty level
-
Process Duration
-
Result
-
Round 1 - One-on-one 

(1 Question)

  • Q1. What is flatMap in java 8?
  • Ans. 

    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...

  • Answered by AI

Skills evaluated in this interview

Interview experience
4
Good
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
Not Selected

I applied via Company Website and was interviewed in Jun 2023. There were 3 interview rounds.

Round 1 - Resume Shortlist 
Pro Tip by AmbitionBox:
Don’t add your photo or details such as gender, age, and address in your resume. These details do not add any value.
View all tips
Round 2 - Coding Test 

Medium level Strings and Array questions

Round 3 - Technical 

(2 Questions)

  • Q1. Find LCA of a node in BST
  • Ans. 

    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.

  • Answered by AI
  • Q2. Optimise the above solution
  • Ans. 

    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

  • Answered by AI

Interview Preparation Tips

Interview preparation tips for other job seekers - Good DSA is required

Skills evaluated in this interview

Interview experience
4
Good
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
Not Selected

I applied via LinkedIn and was interviewed in Feb 2023. There were 2 interview rounds.

Round 1 - Resume Shortlist 
Pro Tip by AmbitionBox:
Keep your resume crisp and to the point. A recruiter looks at your resume for an average of 6 seconds, make sure to leave the best impression.
View all tips
Round 2 - Technical 

(2 Questions)

  • Q1. In java How hasmap works internally
  • Ans. 

    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

  • Answered by AI
  • Q2. Write program in java to print even no by one thread and odd no by another thread
  • Ans. 

    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

  • Answered by AI

Interview Preparation Tips

Interview preparation tips for other job seekers - keep learning new technologies, which will help you in interview.

Skills evaluated in this interview

I applied via Walk-in and was interviewed before Apr 2021. There was 1 interview round.

Round 1 - HR 

(6 Questions)

  • Q1. What are your salary expectations?
  • Ans. 

    Starting as 25,000 in my hands

  • Answered by Sarfraj Mulani
  • Q2. What is your family background?
  • Q3. Share details of your previous job.
  • Q4. What are your strengths and weaknesses?
  • Q5. Tell me about yourself.
  • Q6. Why should we hire you?

Interview Preparation Tips

Topics to prepare for Tech Mahindra Senior Java Developer interview:
  • Core Java
  • Advanced Java
Interview preparation tips for other job seekers - I have need for a job. Also I have prove to itself

Interview questions from similar companies

I applied via LinkedIn and was interviewed in Nov 2021. There was 1 interview round.

Interview Questionnaire 

1 Question

  • Q1. Generics in Java
  • Ans. 

    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, HashMap, and Comparable.

    • Wildcards can be used to allow for flexibility in generic types.

    • Generics can improve code readability and reduce the need for casting.

    • Ge...

  • Answered by AI

Interview Preparation Tips

Interview preparation tips for other job seekers - Prepare thoroughly with basics and coding

Skills evaluated in this interview

I applied via Referral and was interviewed in Sep 2021. There were 6 interview rounds.

Interview Questionnaire 

1 Question

  • Q1. Tell us about Reliability?
  • Ans. 

    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...

  • Answered by AI

Interview Preparation Tips

Interview preparation tips for other job seekers - I have got selected by Interviewer Rajib Das.
Are these interview questions helpful?

Interview Questionnaire 

1 Question

  • Q1. Tell me about software system

Interview Questionnaire 

2 Questions

  • Q1. They asked me on java and I have joined as a fresher they not much questions as I got selected as fresher on oops concepts and collections
  • Q2. Please be confident while facing interview and they will check your communication skills

I applied via Recruitment Consultant and was interviewed before Oct 2020. There was 1 interview round.

Interview Questionnaire 

2 Questions

  • Q1. What is Abstraction
  • Q2. Concept of hiding implementation

Interview Preparation Tips

Interview preparation tips for other job seekers - Not bad, good atmosphere, positive response from staff

Tech Mahindra Interview FAQs

How many rounds are there in Tech Mahindra Senior Java Developer interview?
Tech Mahindra interview process usually has 1-2 rounds. The most common rounds in the Tech Mahindra interview process are Technical, Resume Shortlist and Coding Test.
How to prepare for Tech Mahindra Senior Java Developer interview?
Go through your CV in detail and study all the technologies mentioned in your CV. Prepare at least two technologies or languages in depth if you are appearing for a technical interview at Tech Mahindra. The most common topics and skills that interviewers at Tech Mahindra expect are Java, Spring Boot, Microservices, Spring and Hibernate.
What are the top questions asked in Tech Mahindra Senior Java Developer interview?

Some of the top questions asked at the Tech Mahindra Senior Java Developer interview -

  1. write program in java to print even no by one thread and odd no by another thre...read more
  2. In java How hasmap works interna...read more
  3. What is flatMap in java...read more
What are the most common questions asked in Tech Mahindra Senior Java Developer HR round?

The most common HR questions asked in Tech Mahindra Senior Java Developer interview are -

  1. What are your salary expectatio...read more
  2. What are your strengths and weakness...read more
  3. What is your family backgrou...read more

Tell us how to improve this page.

Overall Interview Experience Rating

4/5

based on 4 interview experiences

Difficulty level

Moderate 100%

Duration

Less than 2 weeks 100%
View more
Tech Mahindra Senior Java Developer Salary
based on 64 salaries
₹7.1 L/yr - ₹26.5 L/yr
7% more than the average Senior Java Developer Salary in India
View more details

Tech Mahindra Senior Java Developer Reviews and Ratings

based on 3 reviews

4.5/5

Rating in categories

4.5

Skill development

4.5

Work-life balance

4.5

Salary

4.5

Job security

4.5

Company culture

4.5

Promotions

4.5

Work satisfaction

Explore 3 Reviews and Ratings
Sr Java Developer -For All locations

Hyderabad / Secunderabad,

Bangalore / Bengaluru

+1

7-12 Yrs

Not Disclosed

Explore more jobs
Software Engineer
26.6k salaries
unlock blur

₹3.7 L/yr - ₹9.3 L/yr

Senior Software Engineer
22.2k salaries
unlock blur

₹9.1 L/yr - ₹18.5 L/yr

Technical Lead
12.5k salaries
unlock blur

₹16.9 L/yr - ₹30 L/yr

Associate Software Engineer
6.1k salaries
unlock blur

₹1.9 L/yr - ₹5.6 L/yr

Team Lead
5.4k salaries
unlock blur

₹5.7 L/yr - ₹17.8 L/yr

Explore more salaries
Compare Tech Mahindra with

Infosys

3.6
Compare

Cognizant

3.7
Compare

Accenture

3.7
Compare

Wipro

3.7
Compare
write
Share an Interview