### Tech Mahindra 21-24th November 2020 Asked Questions | Tips to Follow to Crack Tech Mahindra Exam 2021 | All Sections: Aptitude | Essay | Technical Questions | Coding Question Tech Mahindra 21-24th November 2020 Asked Questions

## Tech Mahindra Exam 2021

Camera On,
Negative marking is there,
you can next and previous questions
You cannot jump a section every section will have its own time.
75 questions aptitude - 142 min
15 min for essay
65 min for coding and 26 technical questions.

## ✓ Technical - 26Q: 65 Mins.

Tech Mahindra Exam review:

The level of questions of aptitude, reasoning, verbal was easy.

Basic coding question.

Essay writing is also a known topic.

.......The total Exam was quite EASY......

Coding Questions with Solutions:

1. findOddEvenDifferences

static int findOddEvenDifferences( int input1,int[] input2)
{

int osum=0;
int esum=0;
for ( int i=0;i<input1;i++)
{

if (input2[i]%2==0)
{
esum=esum+input2[i];

}
else{

osum=osum+input2[i];
}

}

return osum-esum;

}

## return maximum

6. Find the Maximum Difference

int main()
{
int n;
cin>>n;
int a[n];
int maxdiff = 0;

for(int i=0;i<n;i++)
{
cin>>a[i]; //10 11 7 12 14   10-11=-1 11-7=4 7-12=-7 12-14=-2
}
for(int i=0;i<n - 1;i++)
{
if(maxdiff<a[i] - a[i+1])
maxdiff = a[i] - a[i+1];
}
cout<<maxdiff<<endl;

return 0;

}

7. findTotalDistance

public int findTotalDistance( int input1,int[] input2)
{
int sum=0,difference=0;
for ( int i=0;i<input1-1;i++)
{

difference= Math.abs(input2[i]-input2[i+1]);
sum=sum+ difference;

}
return sum;
}

8. findTotalDistance

findTotalDistance(int n, int arr[])
{
int i, distance=0;
for(i=0;i<n-1;i++)
{
distance+= abs(arr[i] - arr[i+1]);
}
return distance;
}