Tech Mahindra interview questions for freshers come after an online assessment and usually cover programming basics, networking, DBMS, your project and HR questions. This page explains the selection process in general terms. It then gives 20 practice questions with sample answers, including the essay and the networking basics that candidates often mention. Every code sample was run to confirm its output.
Important: Tech Mahindra changes its hiring process, test pattern, eligibility and role names from time to time. Use this page to prepare, not as an official description. Always check the official Tech Mahindra careers website and your placement cell notice for the current process.
The Tech Mahindra selection process in general
| Stage | What usually happens |
|---|---|
| Registration | Apply through the official Tech Mahindra careers site or your campus drive |
| Online assessment | Aptitude, verbal ability, essay writing, coding and a personality test, as described in candidate reports |
| Technical interview | Programming, networking, DBMS and your project |
| HR interview | Background, flexibility, relocation and fit |
| Offer | Offer letter, document checks and joining details |
Tech Mahindra, part of the Mahindra Group, works in software services and has a large telecom and networking business. That is why networking questions come up often, even for developer roles. Confirm current roles and rules on the official Tech Mahindra pages.
What the online assessment usually covers
Candidate reports describe sections on quantitative aptitude, logical reasoning and verbal ability, an essay on a general topic, a coding section with one or two problems and a psychometric or personality questionnaire. Some drives have changed the order or dropped a section. The exact pattern, timings and marking change between years, so read the current details from official sources.
Practise aptitude with these placement aptitude questions and coding with simple number, array and string problems.
How to answer in a Tech Mahindra interview
Keep answers short and structured. Give a definition, one example and stop. For programs, explain your approach first, then write the code and test it with a small input.
Pro tip: Draw the OSI model and the TCP three-way handshake from memory once a day for a week. Networking basics are easy marks once they stick.
Tech Mahindra written communication
Q1. How should I write the essay in the online test?
Sample answer: Keep the structure simple and the sentences short.
| Part | What to write |
|---|---|
| Introduction | Restate the topic and give your view |
| Two body paragraphs | One reason or example in each |
| Conclusion | Sum up your view in one or two sentences |
Practise topics such as "Should coding be taught in school?" or "Is 5G important for India?". Avoid slang, check spelling and keep to the word limit shown on screen.
Tech Mahindra technical interview questions
These match commonly reported topics. They are not a list of questions Tech Mahindra will ask.
Q2. Tell me about yourself.
Sample answer: "I am [your name], a final-year ECE student. I learned Python and SQL alongside my branch subjects. My project is a network speed logger in Python that records internet speed every hour and shows a weekly report. I want to start my career in software and learn about networking systems on real projects."
The guide to tell me about yourself has more examples.
Q3. Write a program to check for a leap year.
def is_leap(year):
return (year % 4 == 0 and year % 100 != 0) or year % 400 == 0
for y in [2024, 1900, 2000, 2027]:
print(y, is_leap(y))
Output:
2024 True
1900 False
2000 True
2027 False
1900 is divisible by 4 and 100 but not by 400, so it is not a leap year. 2000 is divisible by 400, so it is. Interviewers check whether you know this rule. See the leap year program in Python for more.
Q4. Find the first non-repeating character in a string.
def first_non_repeating(text):
counts = {}
for ch in text:
counts[ch] = counts.get(ch, 0) + 1
for ch in text:
if counts[ch] == 1:
return ch
return None
print(first_non_repeating("swiss"))
print(first_non_repeating("aabb"))
Output:
w
None
The first loop counts each character, and the second finds the first one with a count of 1. Both loops are O(n).
Q5. Move all zeros to the end of a list.
def move_zeros(nums):
result = [x for x in nums if x != 0]
result += [0] * (len(nums) - len(result))
return result
print(move_zeros([0, 5, 0, 3, 12]))
Output:
[5, 3, 12, 0, 0]
The non-zero values keep their order. The interviewer may ask for an in-place version, which the move zeros problem explains.
Q6. What does list slicing do in Python?
nums = [10, 20, 30, 40, 50]
print(nums[1:4])
print(nums[::-1])
print(nums[-2:])
Output:
[20, 30, 40]
[50, 40, 30, 20, 10]
[40, 50]
Sample answer: Slicing uses [start:stop:step]. The stop index is not included, a step of -1 reverses the list, and negative indexes count from the end. More basics are on the Python interview questions page.
Q7. What are the layers of the OSI model?
Sample answer: Physical, Data Link, Network, Transport, Session, Presentation and Application. Each layer serves the one above it. IP works at the Network layer, TCP and UDP at the Transport layer, and HTTP at the Application layer.
Q8. Explain the TCP three-way handshake.
Sample answer: Before sending data, TCP sets up a connection in three steps. The client sends SYN, the server replies with SYN-ACK, and the client sends ACK. After this, both sides know the other is ready and data transfer starts.
Q9. What is the difference between TCP and UDP?
Sample answer: TCP is connection-oriented and reliable, with ordered delivery and retransmission of lost data. UDP has no connection and no delivery guarantee, so it is faster and suits live video and voice calls. See TCP vs UDP for a full comparison.
Q10. What is the difference between IPv4 and IPv6?
Sample answer: IPv4 uses 32-bit addresses written as four numbers, such as 192.168.1.1, which gives about 4.3 billion addresses. IPv6 uses 128-bit addresses written in hexadecimal groups, which gives a vastly larger address space. IPv6 was created because IPv4 addresses were running out.
Q11. What is the difference between a router and a switch?
Sample answer: A switch connects devices within one local network and forwards data using MAC addresses. A router connects different networks, such as your home network and the internet, and forwards data using IP addresses. More questions are on the computer networks interview questions page.
Q12. What is the difference between DELETE and TRUNCATE?
Sample answer: DELETE removes chosen rows using a WHERE condition and can be rolled back inside a transaction in most databases. TRUNCATE removes all rows at once, cannot use WHERE and is faster. See truncate vs delete for the details.
Q13. What are the four pillars of OOP?
Sample answer: Encapsulation keeps data private behind methods. Abstraction hides details behind a simple interface. Inheritance lets one class reuse another. Polymorphism lets one method name behave differently for different objects. A Phone class with call(), extended by SmartPhone, is a simple example. Follow-ups are in OOPs interview questions.
Tech Mahindra HR interview questions
Q14. Why Tech Mahindra?
Sample answer: Give reasons you can check, such as its mix of software services and telecom work, and its training for freshers. Connect them to your interest. "I am interested in how networks and software work together, and Tech Mahindra works in both."
Q15. Are you willing to relocate and work in shifts?
Sample answer: Answer honestly. "Yes. I understand telecom and support projects may run in shifts, and I am open to relocating." If you have a real constraint, state it politely.
Q16. How do you handle criticism?
Sample answer: "I listen first and ask questions to understand it. In my project review, my guide said my report was hard to follow. I rewrote it with headings and diagrams, and the next review went much better."
Q17. Tell me about a time you helped a teammate.
Sample answer: Use the STAR format. "A classmate was stuck on SQL joins before our lab exam. I explained them with two small tables on paper, and we practised five queries together. She cleared the exam, and explaining it helped me understand joins better too."
Q18. What is your biggest weakness?
Sample answer: Pick a real weakness and show the fix. "I used to start coding before planning. Now I write the steps first, which has cut my debugging time."
Q19. Where do you see yourself in five years?
Sample answer: "I want to become a strong engineer who can own a module and guide new joiners. I would like to build depth in one area, such as backend development or network automation."
Q20. Do you have any questions for us?
Sample answer: "What does the training for freshers cover?" or "Which technologies would I work with first?" Keep it short and genuine.
More HR practice is in HR interview questions for freshers.
A two-week preparation plan for Tech Mahindra
| Days | Focus |
|---|---|
| 1 | Check the current official process and roles |
| 2 to 4 | Aptitude and verbal practice daily |
| 5 | Essay writing: two timed essays, then check grammar |
| 6 to 7 | Your main language and 10 common programs |
| 8 to 9 | Networking: OSI, TCP and UDP, IP addressing, routers and switches |
| 10 | OOP, DBMS and SQL basics |
| 11 | Project explanation and resume check |
| 12 to 13 | HR answers and a mock interview |
| 14 | Light revision |
Common mistakes to avoid
| Mistake | Better approach |
|---|---|
| Skipping networking because the role says "developer" | Revise networking basics anyway |
| Ignoring the essay section | Write two or three timed essays before the test |
| Guessing "ideal" answers in the personality test | Answer honestly and consistently |
| Old blog posts as the source of truth | Check official Tech Mahindra pages for this year |
| Paying for "referrals" or "guaranteed offers" | Apply only through official channels and never pay for a job |
Topics overlap across service companies, so practise TCS interview questions for freshers and Cognizant interview questions for freshers too, and reuse your project and HR stories. Wipro interview questions for freshers has more essay-writing practice.

