Add office photos
Employer?
Claim Account for FREE

Josh Technology Group

3.0
based on 74 Reviews
Filter interviews by

Mahindra Automotives Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Non-Decreasing Array Problem Statement

Given an integer array ARR of size N, determine if it can be transformed into a non-decreasing array by modifying at most one element.

An array is defined as non-decreasin...read more

Ans.

The solution checks if an integer array can become non-decreasing by modifying at most one element.

  • Iterate through the array and check if there are more than one decreasing pairs of elements.

  • If there are more than one decreasing pairs, return false.

  • If there is only one decreasing pair, check if modifying one of the elements can make the array non-decreasing.

  • If modifying the element at index i-1 or i can make the array non-decreasing, return true.

  • Otherwise, return false.

View 2 more answers

Q2. Find Unique Element in Array

You have been provided an integer array/list ARR of size N. Here, N is equivalent to 2M + 1 where each test case has M numbers appearing twice and one number appearing exactly once....read more

Ans.

The task is to find the unique number in an array where all other numbers occur twice.

  • The array size is given by N = 2M + 1, where M is the number of elements occurring twice.

  • Loop through the array and use a hashmap to count the occurrences of each number.

  • Return the number with a count of 1, as it is the unique number.

View 2 more answers

Q3. Sort Linked List Based on Actual Values

You are given a Singly Linked List of integers that is initially sorted according to the absolute values of its elements. Your task is to sort this Linked List based on t...read more

Ans.

The task is to sort a singly linked list based on actual values instead of absolute values.

  • Traverse the linked list and store the values in an array

  • Sort the array using any sorting algorithm

  • Create a new linked list using the sorted array

  • Return the new linked list

Add your answer

Q4. Check If Linked List Is Palindrome

Given a singly linked list of integers, determine if the linked list is a palindrome.

Explanation:

A linked list is considered a palindrome if it reads the same forwards and b...read more

Add your answer
Discover Mahindra Automotives interview dos and don'ts from real experiences
Q5. ...read more

Diameter of a Binary Tree Problem Statement

Given a binary tree, return the length of its diameter. The diameter of a binary tree is defined as the length of the longest path between any two nodes in the tree.

Ans.

The diameter of a binary tree is the length of the longest path between any two end nodes in the tree.

  • The diameter of a binary tree can be calculated by finding the maximum of the following three values: 1) the diameter of the left subtree, 2) the diameter of the right subtree, and 3) the longest path that passes through the root node.

  • To find the diameter of a binary tree, we can use a recursive approach. We calculate the height of the left and right subtrees, and then calcul...read more

Add your answer

Q6. Merge K Sorted Arrays Problem Statement

Given 'K' different arrays that are individually sorted in ascending order, merge all these arrays into a single array that is also sorted in ascending order.

Input

The f...read more
Add your answer

Q7. Remove Duplicates Problem Statement

You are given an array of integers. The task is to remove all duplicate elements and return the array while maintaining the order in which the elements were provided.

Example...read more

Add your answer

Q8. Segregate Odd-Even Problem Statement

In a wedding ceremony at NinjaLand, attendees are blindfolded. People from the bride’s side hold odd numbers, while people from the groom’s side hold even numbers. For the g...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Mahindra Automotives

based on 8 interviews
3 Interview rounds
Coding Test Round - 1
Coding Test Round - 2
Assignment Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Front end Developer Interview Questions from Similar Companies

3.9
 • 15 Interview Questions
4.1
 • 13 Interview Questions
3.2
 • 13 Interview Questions
4.0
 • 13 Interview Questions
3.6
 • 12 Interview Questions
4.9
 • 11 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter