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

Product Development Engineer

Tech Mahindra Pvt. Ltd
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2.5 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Practice daily question of DS algo
Tip 2 : Prepare all your projects

Application process
Where: Campus
Eligibility: 6.5 CGPA
Resume Tip
Resume tip

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration60 minutes
Interview date20 Nov 2021
Coding problem2

1. Encode The String

Easy
10m average time
80% success
0/40
Asked in companies
Goldman SachsDeloitteMahindra Comviva

You are given a string ‘S’ of length ‘N’. The string can be encoded using the following rules:

1) If the ‘i-th’ character is a vowel, change it to the next character in the alphabetical sequence. For example, the next character of ‘o’ is ‘p’.

2) If the ‘i-th’ character is a consonant, change it to the previous character in the alphabetical sequence. For example, the previous character of ‘h’ is ‘g’.

3) The next character of ‘z’ is ‘a’.

4) The previous character of ‘a’ is ‘z’.

Find the encoded string.

Example :
‘N’ = 4, ‘S’ = “code”

Character ‘c’ gets changed to ‘b’.
Character ‘o’ gets changed to ‘p’.
Character ‘d’ gets changed to ‘c’.
Character ‘e’ gets changed to ‘f’.

Encoded string = “bpcf”
Problem approach

Pick the first character from the source string. 
Append the picked character to the destination string. 
Count the number of subsequent occurrences of the picked character and append the count to the destination string. 
Pick the next character and repeat steps 2, 3 and 4 if the end of the string is NOT reached.

Try solving now

2. Common Elements In Three Sorted Arrays

Moderate
35m average time
65% success
0/80
Asked in companies
MicrosoftOptumSAP Labs

You are given three arrays 'A', 'B' and 'C' of length 'N', 'M' and 'K' respectively. All the three arrays are sorted in non-decreasing order. Your task is to find all such elements which are present in all the three given arrays.

Note:

1. The output array should have the same ordering of elements as the original arrays.
2. Even if a particular element appears more than once in each of the three arrays, it should still be present only once in the output array.
3. If there are no common elements in the arrays, return an empty array.

For example:

Consider the three arrays A = [ 2, 3, 4, 7 ] , B = [ 0, 0, 3, 5 ] , C = [ 1, 3, 8, 9 ]
The output array should be [ 3 ] as 3 is the only element which is present in all the three arrays.
Problem approach

A simple solution is to first find intersection of two arrays and store the intersection in a temporary array, then find the intersection of third array and temporary array. 
Time complexity of this solution is O(n1 + n2 + n3) where n1, n2 and n3 are sizes of ar1[], ar2[] and ar3[] respectively.

Try solving now
02
Round
Easy
Video Call
Duration30 minutes
Interview date29 Nov 2020
Coding problem3

The interviewer ask me questions related to my projects sql and DS algo coding questions

1. Add One to Linked List

Easy
10m average time
90% success
0/40
Asked in companies
UberSamsung R&D InstitutePayPal

Ninja has been given a number that is represented in the form of a linked list such that each digit corresponds to a node. He has been asked to add 1 to it and return the updated list.

For Example:

1234 is represented as (1 -> 2 -> 3 -> 4) and adding 1 to it should change it to (1 -> 2 -> 3 -> 5).

Note:

The input Linked list does not have any trailing zeros.
Problem approach

Reverse given linked list. For example, 1-> 9-> 9 -> 9 is converted to 9-> 9 -> 9 ->1.
Start traversing linked list from leftmost node and add 1 to it. If there is a carry, move to the next node. Keep moving to the next node while there is a carry.
Reverse modified linked list and return head.

Try solving now

2. Kth Smallest Element

Easy
15m average time
85% success
0/40
Asked in companies
Info Edge India (Naukri.com)DelhiveryIntuit

You are given an array of integers 'ARR' of size 'N' and another integer 'K'.


Your task is to find and return 'K'th smallest value present in the array.


Note: All the elements in the array are distinct.


Example
If 'N' is 5 and 'K' is 3 and the array is 7, 2, 6, 1, 9

Sorting the array we get 1, 2, 6, 7, 9

Hence the 3rd smallest number is 6.
Problem approach

A simple solution is to sort the given array using an O(N log N) sorting algorithm like Merge Sort, Heap Sort, etc, and return the element at index k-1 in the sorted array. 
The Time Complexity of this solution is O(N log N)

Try solving now

3. DBMS Question

what is normalization?

Here's your problem of the day

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

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
Software Engineer
1 rounds | 4 problems
Interviewed by Tech Mahindra Pvt. Ltd
1910 views
1 comments
0 upvotes
Data Analyst
3 rounds | 4 problems
Interviewed by Tech Mahindra Pvt. Ltd
1803 views
1 comments
0 upvotes
SDE - Intern
2 rounds | 4 problems
Interviewed by Tech Mahindra Pvt. Ltd
1319 views
0 comments
0 upvotes
Software Engineer
2 rounds | 4 problems
Interviewed by Tech Mahindra Pvt. Ltd
0 views
0 comments
0 upvotes