Tech Mahindra technical interview questions and answers

Tech Mahindra technical interview questions usually cover one programming language in depth, object-oriented programming, DBMS and SQL, operating systems, computer networks and your final-year project, plus a short coding problem you solve on paper or a shared screen. For freshers, the round tends to stay close to what your résumé claims, so the strongest preparation is knowing your own project and your chosen language well.

By Published 9 min read

How the Tech Mahindra hiring process usually runs

Tech Mahindra is an IT services and consulting company in the Mahindra Group. It hires freshers through campus drives and off-campus drives, and experienced engineers through regular job postings. The steps below are what candidates most often describe for fresher hiring. Treat them as a typical shape, not a rule: the company changes its assessment pattern from one hiring season to the next, and your invitation email or the drive notice is the source to trust.

  1. Online assessment. Commonly aptitude, logical reasoning and verbal ability. Some drives add an essay or written English section, a short coding section or a personality questionnaire. Sections are usually timed separately.
  2. Technical interview. One interviewer, sometimes two, for roughly a conversation's length. This page covers it.
  3. HR interview. Background, relocation, shift flexibility, documents and the service agreement terms in general. See the Tech Mahindra HR interview guide.
  4. Offer and onboarding. Offer letters, joining dates and training arrive later, and the wait varies a lot between batches.

For lateral (experienced) roles the technical round is longer and goes deep into the stack on the job post: Java and Spring, .NET, testing tools, SAP, networking or cloud. Several candidates also report a second technical or managerial round for lateral hires.

What the technical interviewer is checking

A services company staffs engineers onto client projects, often within weeks of training ending. The technical interviewer is answering one question: can this person learn a client's stack quickly and write correct, readable code without constant help? That is why the round leans on fundamentals and on your own work rather than on hard algorithm puzzles. A clear, honest answer to a basic question beats a confused attempt at an advanced one.

  • Depth in one language. Pick the language you know best and say so. Interviewers often let you choose, then go deep.
  • Concepts you can explain in plain words. Polymorphism, normalization and deadlock should come out as simple explanations with an example.
  • Code that runs in your head. For small problems, they watch how you trace inputs and edge cases.
  • Ownership of your project. What you built, not what the team built.

Programming and OOP questions

Language and object-oriented questions
QuestionWhat it testsWhat a strong answer shows
Explain the four pillars of OOP with one example from your project.OOP basics tied to real code.Encapsulation, inheritance, polymorphism and abstraction each mapped to a class you actually wrote.
What is the difference between method overloading and method overriding?Compile-time vs runtime polymorphism.Same name with different parameters vs a subclass replacing a parent method, plus a two-line example.
Abstract class or interface: when would you use each?Design judgment.Shared state and partial code vs a pure contract, and a mention that Java interfaces can now hold default methods.
Why is String immutable in Java?Language internals.The string pool, safe sharing between threads and safe use as a map key.
What is the difference between == and equals()?Reference vs value comparison.A concrete example with two String objects and the result of each check.
Explain pointers and the difference between malloc and calloc in C.Memory basics for C candidates.calloc zeroes memory and takes a count and a size; both need free, and forgetting it leaks.
What is a constructor, and can it be private?Object creation.Yes, and the singleton pattern as the classic reason.
How does exception handling work, and what does finally guarantee?Error handling.try, catch, finally, checked vs unchecked exceptions in Java, and the rare cases finally does not run.
What is the difference between a list and a tuple in Python?Python basics.Mutability, why tuples can be dictionary keys, and when each fits.
What is garbage collection?Memory management in managed languages.Objects with no references are reclaimed automatically; you still close files and connections yourself.
Language and object-oriented questions. Scroll sideways on a small screen.

DBMS and SQL questions

Almost every client project touches a database, so this section rarely gets skipped. Practice writing queries by hand, because many interviews happen on paper or in a plain text box without autocomplete.

Database questions
QuestionWhat it testsWhat a strong answer shows
Write a query to find the second highest salary in an Employee table.Subqueries or window functions.A subquery with MAX below the MAX, or DENSE_RANK, and what happens with ties.
Explain INNER, LEFT and FULL OUTER joins.Join semantics.Which rows survive each join, shown with two small tables.
What is normalization? Walk through 1NF, 2NF and 3NF.Schema design.Removing repeating groups, partial dependencies and transitive dependencies, each with an example column.
What is the difference between DELETE, TRUNCATE and DROP?DDL vs DML.Row-level delete with WHERE, fast removal of all rows, and removing the table itself.
What are the ACID properties?Transactions.Atomicity, consistency, isolation and durability, illustrated with a money transfer.
Primary key vs unique key vs foreign key.Constraints.Nulls allowed or not, how many per table, and what a foreign key protects.
What is an index, and when does it slow things down?Performance basics.Faster reads, slower writes and extra storage; low-selectivity columns gain little.
Write a query to count employees per department and show only departments with more than five.GROUP BY and HAVING.HAVING filters groups after aggregation, WHERE filters rows before it.
Database questions. Scroll sideways on a small screen.

Operating systems and networking questions

Communications is one of the businesses Tech Mahindra is best known for, so networking questions are worth extra revision even if your project had nothing to do with telecom. Keep answers conceptual and correct; nobody expects you to configure a router.

  • What is the difference between a process and a thread? A process has its own memory space; threads share the memory of their process. Give a browser tab or a server handling requests as an example.
  • What is a deadlock, and what four conditions cause it? Mutual exclusion, hold and wait, no preemption and circular wait. Mention one way to break a condition, such as always taking locks in the same order.
  • Explain paging and virtual memory. Memory is split into fixed-size pages, mapped to frames through a page table, so programs can use more address space than physical RAM.
  • What are the common CPU scheduling algorithms? FCFS, shortest job first, priority and round robin, with one line on the trade-off of each.
  • Name the layers of the OSI model and where TCP/IP fits. Seven layers from physical to application; TCP/IP collapses them into four or five.
  • TCP vs UDP: which would you use for a video call and why? UDP, because a late packet is useless and retransmission adds delay; TCP for file transfer where every byte matters.
  • What happens when you type a URL into a browser? DNS lookup, TCP connection, TLS handshake for HTTPS, the HTTP request, the response and rendering.
  • What is the difference between a hub, a switch and a router? Broadcast to all ports, forwarding by MAC address within a network, and routing by IP address between networks.
  • What is a subnet mask? It splits an IP address into network and host parts. Be ready to say how many hosts a /24 network holds.
  • What is 4G vs 5G at a high level? Only if you mention telecom interest: higher bandwidth, lower latency and support for many more connected devices. Keep it general.

Coding questions

Coding in this round is usually short. You may be asked to write it on paper, in a shared editor or in an online compiler while the interviewer watches. Say your approach first, write clean code, then trace one normal input and one edge case aloud.

  • Reverse a string without using a built-in reverse. Two pointers swapping from the ends.
  • Check whether a number is prime. Test divisors up to the square root, and handle 0, 1 and 2.
  • Print the Fibonacci series up to n terms, then do it recursively. Explain why the naive recursion is slow.
  • Find the second largest element in an array. One pass with two variables; decide what to return when all values are equal.
  • Check whether a string is a palindrome, ignoring case and spaces. Normalize first, then compare.
  • Count the vowels and consonants in a sentence. A clean loop and correct handling of digits and punctuation.
  • Swap two numbers without a third variable. Arithmetic or XOR, with the overflow caveat for the arithmetic version.
  • Remove duplicates from an array. A set, or sort and skip, and the order question each raises.
  • Find the factorial of a number using recursion. The base case and what happens for large n.
  • Check whether two strings are anagrams. Sort both or count characters; the counting version is linear.
def second_largest(nums):
    first = second = None
    for n in nums:
        if first is None or n > first:
            first, second = n, first
        elif n != first and (second is None or n > second):
            second = n
    return second  # None when there is no distinct second value

print(second_largest([10, 4, 10, 7]))  # 7
print(second_largest([5, 5]))          # None
Second largest distinct value in one pass

Project and résumé questions

For many freshers this is the longest part of the round. Interviewers pick something from your résumé and keep asking why until they find the edge of what you know. Anything you list is fair game, including a certification or a language you used once.

Project questions
QuestionWhat it testsWhat a strong answer shows
Explain your final-year project in two minutes.Clarity.Problem, users, your stack and the result, in that order, without jargon.
What was your exact contribution?Honesty and ownership.Specific modules or features you wrote, not the whole team's work.
Draw the architecture or the database tables.Real understanding.A simple diagram with the main tables, keys and how data flows.
Why did you choose this technology over another?Decision making.A reason tied to the problem, or an honest note that it was what the team knew.
What was the hardest bug and how did you find it?Debugging approach.The symptom, how you narrowed it down and the fix.
If you rebuilt it today, what would you change?Reflection.One concrete improvement, such as validation, tests or a better schema.
Project questions. Scroll sideways on a small screen.

Fictional example

Answering a project question from a fresher
Interviewer
Tell me about your project and your role in it.
Candidate
We built a hostel complaint tracker for our college. Students raise a complaint, the warden assigns it and the student sees the status. It used Java with Spring Boot and a MySQL database. There were three of us, and I owned the database design and the complaint status APIs.
Interviewer
How did you design the tables?
Candidate
Students, staff, complaints and a status history table. I kept history separate so we never overwrite who changed a status and when. Complaints has foreign keys to the student and the assigned staff member.
Interviewer
What would you improve?
Candidate
We had no pagination, so the warden's list got slow once we loaded test data. I would add pagination and an index on status and created date.

A two-week preparation plan

  1. Days 1 to 3: your languageRevise OOP, exceptions, collections or the standard library, and string handling in the one language you will claim. Write ten small programs by hand.
  2. Days 4 to 6: DBMS and SQLWrite joins, GROUP BY, subqueries and the second-highest-salary family of queries on paper. Revise normalization and ACID with your own examples.
  3. Days 7 to 9: OS and networksProcesses, threads, deadlock, scheduling, paging, OSI, TCP vs UDP and what happens when you open a website.
  4. Days 10 to 11: your projectPractice the two-minute explanation, draw the architecture from memory and list three questions you hope they do not ask. Then prepare answers for those three.
  5. Days 12 to 14: mocksRun two mock technical rounds with a friend or recorded on your own. Do one round of the general software engineer questions to stretch beyond the basics.

If you are also applying to product companies, compare this round with the Zoho software engineer guide, where application-style programming rounds go much deeper.

Natively can sit in on your rehearsals. Run a mock technical round on your laptop and it writes a live transcript, so afterwards you can see where you rambled on normalization or skipped the edge case. Take a screenshot of a practice coding question and it reads the problem and can suggest an approach to compare with your own. Add your résumé and the drive's job description (Pro or the free trial) and its suggested answers for project questions draw on what you actually built. The notes and transcript stay in your history for the next session. Read more about an AI interview assistant.

Questions people ask

What questions are asked in the Tech Mahindra technical interview?

Mostly fundamentals: OOP in your chosen language, SQL queries and normalization, operating system and networking concepts, a short coding problem, and detailed questions about your project and résumé.

Is the Tech Mahindra technical interview difficult for freshers?

It is usually fundamentals-heavy rather than puzzle-heavy. Candidates who know one language well, can write basic SQL by hand and can explain their own project clearly tend to find it manageable.

Which programming language should I choose for the Tech Mahindra interview?

The one you know best. Interviewers often let you pick and then ask deeper questions in it, so depth in one language beats a shallow claim to several.

How do I prepare for the Tech Mahindra technical round?

Revise OOP, DBMS, OS and networking basics, write ten to twenty small programs by hand, practice SQL on paper and rehearse a two-minute explanation of your project with its architecture.

Where to go next

Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.

Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.

Keep reading

Put it on your own machine.

A live-conversation assistant that runs locally. Your conversations stay on your machine.

macOS 12+ · Windows 10/11

© 2026 Natively AI Private Limited

Source-available under the Natively Personal Use Source License v1.0 · IP geolocation by DB-IP