Problem database last updated: June 20, 2025

TTech Mahindra logo

Tech Mahindra Coding Interview Questions

5 problems · 3 Easy, 2 Medium, 0 Hard · Ranked #232 of 458

Difficulty breakdown

3 Easy

60% · avg 23%

2 Medium

40% · avg 59%

0 Hard

0% · avg 18%

Top topics

array
60%
math
40%3.2x
dynamic-programming
20%
hash-map
20%12.7x
hash-table
20%
string
20%

Interview profile

Based on 5 reported problems, Tech Mahindra interviews are easier than average - only 0% Hard compared to 18% across all companies.

Compared to the industry average, Tech Mahindra puts unusual emphasis on math (40% of problems, 3.2x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (60%), math (40%), dynamic-programming (20%), hash-map (20%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 5 problems

Best Time to Buy and Sell Stock

Solve

You are given an array prices where prices[i] is the price of a given stock on the ith day.

EasyVery Likely
arraydynamic-programming

Two Sum

Solve

Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target.

EasyVery Likely
arrayhash-map

Reverse Integer

Solve

Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1...

MediumVery Likely
math

Valid Anagram

Solve

Given two strings s and t, return true if t is an anagram of s, and false otherwise.

EasyVery Likely
hash-tablestringsorting

Count Primes

Solve

Given an integer n, return the number of prime numbers that are strictly less than n.

MediumVery Likely
arraymathenumeration

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Tech Mahindra interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Tech Mahindra coding interview

Tech Mahindra interviews focus heavily on array, math, dynamic-programming problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. Tech Mahindra interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Tech Mahindra ask in interviews?add

Tech Mahindra has been reported to ask 5 distinct coding problems. The most common topics are array, math, dynamic-programming. 3 are Easy difficulty, 2 are Medium, and 0 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Tech Mahindra coding interviews?add

Based on 5 reported problems, Tech Mahindra interviews are easier than average - only 0% Hard compared to 18% across all companies. 40% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a Tech Mahindra coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, math, dynamic-programming. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Tech Mahindra interview?

Simulate a real Tech Mahindra coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Tech Mahindra interview with AIarrow_forward