Tech Mahindra Previous Year Coding Questions and Hiring Process

Tech Mahindra is one of the largest IT services companies in India and hires freshers in huge numbers every year through campus and off campus drives. It recruits from B.E./B.Tech and MCA backgrounds across CSE, IT, ECE, EEE, and other engineering branches, with an optional Super Coder Challenge track for candidates who want a higher starting package.

If you are preparing for Tech Mahindra, understanding the assessment structure, the Automata coding round, the AI based communication test, and the interview expectations will help you prepare efficiently. This guide covers the complete Tech Mahindra hiring process along with previous year coding questions asked in its online assessments and interviews.

Tech Mahindra Hiring Process

Here is the typical flow for Tech Mahindra fresher hiring through campus and off campus drives.

StageWhat HappensWhat They Are Looking For
  1. Eligibility and Registration
Apply through your college placement cell or an off campus drive. Requires around 60 percent aggregate or 6.0 to 6.5 CGPA across 10th, 12th, and graduation, with no active backlogs at the time of hiring. Consistent academic record and eligible branch.
  1. Aptitude and English Assessment
Around 36 to 40 questions across logical reasoning, quantitative ability, and verbal English, plus a short essay writing task, all in one timed sitting. Speed and accuracy under time pressure, plus written communication.
  1. Technical and Automata Coding Round
Technical MCQs on programming, DBMS, operating systems, and networks, followed by two coding problems in the Automata Fix format, solvable in C, C++, Java, or Python. Conceptual clarity and working code under time pressure.
  1. AI Based Communication Assessment
A Versant style spoken English test with read aloud, repeat sentence, error correction, and extempore tasks on a given topic. Spoken fluency and comfort communicating in English.
  1. Technical Interview
A short interview covering your projects, core CS fundamentals, and sometimes live logic or coding questions. Depth of understanding, not just memorised answers.
  1. HR Interview
A conversation about your background, willingness to relocate, salary expectations, and interest in joining Tech Mahindra. Cultural fit and career clarity.

Most campus drives complete all stages within a single day, and each stage gates entry to the next. The written test in particular is often non-adaptive, meaning you cannot revisit or change an answer once you move past a question, so pace yourself carefully within each section.

Assessment Pattern

Format: A proctored online test combining aptitude, English, technical MCQs, and coding in one sitting, followed by a separate AI based spoken communication assessment.

Sections typically included:

  1. Logical Reasoning: Number series, blood relations, coding decoding, seating arrangements.
  2. Quantitative Aptitude: Profit and loss, ages, time and work, speed and distance, probability, data interpretation.
  3. Verbal English: Fill in the blanks, error detection, reading comprehension, sentence correction.
  4. Essay Writing: A short 200 to 250 word essay on a general topic, non MCQ.
  5. Technical MCQs: Programming basics, SQL, data structures, operating systems, computer networks, and software testing.
  6. Automata Coding Round: Two coding problems, around 45 minutes total, in C, C++, Java, or Python.
  7. AI Communication Assessment: Read aloud, repeat sentence, error correction in spoken sentences, and a short extempore on a given topic.

Tech Mahindra Coding Round: What to Expect

The Automata coding round at Tech Mahindra mixes classic programming problems with aptitude style word problems that need to be solved in code. Frequently reported topics include:

  • Array based counting and difference problems (odd versus even counts, sums at specific positions)
  • Word problems converted into code, such as interest calculation or material cutting problems
  • String manipulation basics such as reversal, palindrome checks, and vowel counting
  • Number theory basics such as prime checking and decimal to binary conversion
  • Pattern printing and simple loop based logic

For hands on practice, use:

Technical Interview and MCQ Focus Areas

  • Programming Fundamentals: C, C++, Java basics, tokens, function overloading, call by value versus call by reference.
  • Object Oriented Programming: Encapsulation, abstraction, polymorphism, inheritance, and the difference between a class and an object.
  • Operating Systems: Process states, paging versus swapping, multiprocessing, microkernels, reentrancy, spooling.
  • Database Concepts: ACID properties, checkpoints, tuples, transparent distributed databases, SQL statements to modify data.
  • Computer Networks: Network topologies, WAN concepts, OSI and TCP/IP basics.
  • Software Testing: Unit testing, white box versus black box testing, faults versus errors.
  • Project Discussion: Be ready to explain your final year or academic project clearly, including your specific role and the challenges you faced.

Complete Interview Questions

HR Interview Tips

The HR round checks communication, motivation, and overall fit. Common questions include:

  • Tell me about yourself.
  • Why do you wish to work in information technology.
  • What makes you want to work at Tech Mahindra specifically.
  • Are you open to relocating.
  • What salary expectations do you have.
  • What are your strengths and weaknesses.
  • Discuss your short term and long term career goals.

Complete HR Interview Questions

Answer with specific examples from your projects and internships rather than generic statements.

Resources to Prepare for Tech Mahindra


Tech Mahindra Previous Year Coding Questions

Below is a list of Tech Mahindra previous year coding questions commonly reported by candidates in the Automata round and written tests. Each question includes a problem statement, input and output format, and a sample explanation.

1. Odd Even Count Difference

Problem Statement: Given an array of integers, find the difference between the count of odd numbers and the count of even numbers.

Input Format:

  • An integer array arr

Output Format:

  • A single integer representing the difference

Example: Input: [1, 2, 3, 4, 5] Output: 1

2. Sum of Absolute Differences From a Position

Problem Statement: Given an array and a starting position, calculate the sum of absolute differences between each pair of adjacent numbers starting from that position.

Input Format:

  • An integer array arr and a starting index pos

Output Format:

  • A single integer representing the total sum

Example: Input: arr = [4, 9, 1, 7], pos = 0 Output: 13

3. Sum Difference at Even and Odd Indices

Problem Statement: Given an array, find the difference between the sum of elements at even indices and the sum of elements at odd indices.

Input Format:

  • An integer array arr

Output Format:

  • A single integer representing the difference

Example: Input: [3, 7, 2, 8, 5] Output: 3

4. Cloth Merchant Curtain Problem

Problem Statement: A cloth merchant has pieces of cloth of various lengths. Given a fixed length required to make one curtain, calculate how many complete curtains can be made from all the pieces combined.

Input Format:

  • An array of piece lengths and an integer curtainLength

Output Format:

  • The total number of complete curtains that can be made

Example: Input: pieces = [15, 20, 10], curtainLength = 12 Output: 3

5. Total Interest on Loan Amounts

Problem Statement: Given a list of loan amounts, calculate 20 percent interest only on the portion of each amount that exceeds 1000, and return the total interest across all amounts.

Input Format:

  • An array of loan amounts

Output Format:

  • The total interest, rounded to two decimal places

Example: Input: [1200, 800, 1500] Output: 140.00

6. Even Odd Value Sum Difference

Problem Statement: Given an array of integers, return the difference between the sum of even valued elements and the sum of odd valued elements.

Input Format:

  • An integer array arr

Output Format:

  • A single integer representing the difference

Example: Input: [1, 2, 3, 4, 5] Output: -3

7. Reverse a Number

Problem Statement: Given an integer, reverse its digits and return the reversed number.

Input Format:

  • An integer n

Output Format:

  • The reversed integer

Example: Input: 12345 Output: 54321

8. Count Items Requiring Cold Storage

Problem Statement: Given an array of temperatures, count how many items need to be stored below 0 degrees.

Input Format:

  • An integer array temperatures

Output Format:

  • The count of items with temperature below 0

Example: Input: [-5, 3, -2, 0, 10, -8] Output: 3

9. Decimal to Binary Conversion

Problem Statement: Given a decimal integer, convert it into its binary representation.

Input Format:

  • An integer n

Output Format:

  • The binary string

Example: Input: 18 Output: 10010

10. Longest Palindromic Substring

Problem Statement: Given a string, find the longest substring that is a palindrome.

Input Format:

  • A string s

Output Format:

  • The longest palindromic substring

Example: Input: babad Output: bab

11. Valid Anagram Check

Problem Statement: Given two strings, determine whether one is an anagram of the other.

Input Format:

  • Two strings s1 and s2

Output Format:

  • "Yes" or "No"

Example: Input: s1 = "listen", s2 = "silent" Output: Yes

12. Swap Three Numbers Without a Temporary Variable

Problem Statement: Given three numbers, rotate their values (a gets b's value, b gets c's value, c gets a's original value) without using a fourth temporary variable.

Input Format:

  • Three integers a, b, c

Output Format:

  • The rotated values of a, b, and c

Example: Input: a = 1, b = 2, c = 3 Output: a = 2, b = 3, c = 1

13. Check Prime Number

Problem Statement: Given an integer, determine whether it is a prime number.

Input Format:

  • An integer n

Output Format:

  • "Prime" or "Not Prime"

Example: Input: 29 Output: Prime

14. Check Palindrome String

Problem Statement: Given a string, determine whether it reads the same forwards and backwards.

Input Format:

  • A string s

Output Format:

  • "Palindrome" or "Not Palindrome"

Example: Input: madam Output: Palindrome

15. Count Vowels and Consonants

Problem Statement: Given a string, count the number of vowels and consonants in it.

Input Format:

  • A string s

Output Format:

  • Two integers, the vowel count and the consonant count

Example: Input: hello world Output: Vowels = 3, Consonants = 7

16. Merge Two Sorted Arrays

Problem Statement: Given two sorted arrays, merge them into a single sorted array.

Input Format:

  • Two sorted integer arrays arr1 and arr2

Output Format:

  • The merged sorted array

Example: Input: arr1 = [1, 3, 5], arr2 = [2, 4, 6] Output: [1, 2, 3, 4, 5, 6]

17. Remove Duplicates From an Array

Problem Statement: Given an array of integers, remove duplicate values while keeping the first occurrence of each value.

Input Format:

  • An integer array arr

Output Format:

  • The array with duplicates removed

Example: Input: [1, 2, 2, 3, 4, 4, 5] Output: [1, 2, 3, 4, 5]

18. Print Fibonacci Series

Problem Statement: Given a number n, print the first n terms of the Fibonacci series.

Input Format:

  • An integer n

Output Format:

  • The first n Fibonacci numbers

Example: Input: 6 Output: 0, 1, 1, 2, 3, 5

19. Find the Maximum Element in an Array

Problem Statement: Given an array of integers, find the maximum element.

Input Format:

  • An integer array arr

Output Format:

  • The maximum element

Example: Input: [5, 1, 9, 3, 7] Output: 9

Technical MCQs Reported in Past Drives

These are frequently reported technical MCQ topics from the Tech Mahindra written test:

  1. Which of the following is the biggest WAN in the world? (Answer: The Internet)
  2. How many nodes does a full binary tree with n leaves contain?
  3. Which SQL statement is used to modify a column's value in a table?
  4. In which network topology are all workstations connected to a single cable? (Answer: Bus topology)
  5. What is it called when a single computer uses more than one CPU? (Answer: Multiprocessing)
  6. What is the first level of software testing? (Answer: Unit testing)
  7. Structural testing is also known as which type of testing? (Answer: White box testing)
  8. Is a bug a fault or an error?
  9. In RDBMS, what does a tuple refer to? (Answer: A row or record)
  10. What is the difference between #include <file> and #include "file" in C?

Technical Interview Theory Questions

Real questions reported by candidates in the technical interview round:

  1. Differentiate between swapping and paging.
  2. What is a request processor and a request dispatcher in Java?
  3. What do you understand about servlet collaboration?
  4. State the different states of a process.
  5. Define microkernels in the context of operating systems.
  6. What is reentrancy in multiprogramming or time sharing systems?
  7. Define spooling in operating systems.
  8. State the advantages of multithreaded programming.
  9. What do you understand by tokens in C or C++?
  10. What is the difference between call by value and call by reference?
  11. What do you understand by function overloading?
  12. Define inline functions in C and C++.
  13. What are destructors in C++?
  14. What is the finalize method used for in Java?
  15. Differentiate between a class and an object.
  16. What are the ACID properties in DBMS?
  17. What do you understand by a checkpoint in DBMS?
  18. What are transparent distributed database management systems?
  19. Explain the Java Virtual Machine and its memory areas.
  20. Explain classloaders in Java and their different types.
  21. What are the four pillars of object oriented programming?
  22. Differentiate between abstraction and encapsulation.
  23. What are the ways to achieve compile time polymorphism?
  24. Write a program without using a main function. (a conceptual C trick question testing your understanding of program entry points)

At Last

Tech Mahindra tests a wide spread of skills in a single sitting, from aptitude speed to core CS fundamentals to spoken English, so time management across sections matters as much as raw knowledge. Practice mental math for the aptitude section, revise core programming and CS concepts, and speak out loud during your mock preparation so the AI communication round feels familiar rather than stressful.

Join the Telegram group for more resources and discussions.

Useful Resources for Your Placement Prep