Tech Mahindra Interview Questions for 2023

Tech Mahindra Interview Questions

Interview Preparation Tips for Tech Mahindra

Here are some tips to help you prepare for a Tech Mahindra interview:

  1. Research the company: Familiarize yourself with Tech Mahindra’s history, mission, values, and offerings. This will show the interviewer that you are interested in the company and have a good understanding of what it does.
  2. Review the job description and requirements: Make sure you understand the requirements and responsibilities of the role you are applying for. This will help you tailor your answers to the specific needs of the position.
  3. Practice your responses: Come up with examples from your past experience that highlight your skills and abilities. This will help you feel more confident and prepared for the interview.
  4. Dress appropriately: Choose business attire that is professional and appropriate for the role you are applying for.
  5. Arrive on time: Plan to arrive a few minutes early to allow for any unexpected delays.
  6. Bring copies of your resume and any relevant documents: It’s a good idea to bring copies of your resume and any relevant documents, such as references or portfolio samples.
  7. Prepare questions: Have a list of questions ready to ask the interviewer. This shows that you are engaged and interested in the role and the company.
  8. Practice good body language: Make eye contact, smile, and sit up straight to show that you are confident and engaged.

By following these tips, you can increase your chances of success in a Tech Mahindra interview. Good luck!

Tech Mahindra Technical Interview Questions: Experienced and Freshers

1. Explain the difference between #include <file> and #include “file”.

In C and C++, the preprocessor directive #include is used to include the contents of a file into the source code of a program. The difference between the two forms of the directive, #include <file> and #include "file", lies in the way the compiler searches for the file being included.

When #include <file> is used, the compiler looks for the file in a system-specific list of directories that contain system header files. These directories are specified by the compiler and are typically different from the directories where user-defined header files are stored. This form of the #include directive is usually used for system header files, such as those that come with the C or C++ standard library.

On the other hand, when #include "file" is used, the compiler looks for the file in the current directory and any directories specified in the compiler’s search path. This form of the #include directive is typically used for user-defined header files.

In summary, #include <file> is used to include system header files, while #include "file" is used to include user-defined header files. It’s important to use the correct form of the #include directive, as using the wrong form may result in the compiler being unable to find the file being included.

2. Explain the difference between call by reference and call by value?

Before moving forward to look at the differences between call by reference and call by value, let us know the definitions of them:

  • Call by Reference: Here, both the formal and actual parameters relate to the same place; thus, any modifications made within the function are mirrored in the actual parameters of the caller.
  • Call by Value: The principles of actual parameters are transferred to the formal parameters in this parameter passing method, and two kinds of parameters are kept in distinct memory locations. Consequently, any modifications performed within functions are not mirrored in the actual parameters passed to the caller.

Let’s now examine the difference between Call by Reference and Call by Value.

Call by ReferenceCall by Value
The addresses of the real variables of the calling function are transferred into the fake variables of the caller function.The value of every variable in the calling function is moved into the corresponding dummy variables of the called function.
Because the addresses of the real variables of the calling function are supplied to the called function, any modifications done to the variables in the call function are mirrored in the calling function’s variables.Modifications to the called function’s dummy variables have no effect on the actual variables’ values in the calling function when using Call by Value. 
We may modify the real values of variables by using function calls.We cannot modify the values of real variables using function calls.

3. What exactly do you mean by Function Overloading?

Function Overloading is a characteristic of object-oriented programming (OOP) that permits more than two functions to have similar names but different arguments. When a function name is burdened with many duties, this is known as function overloading. In Function Overloading, the “Function” name must be similar, but the parameters must be different. Polymorphism is a C++ feature that allows you to overload functions.

4. Please list a few OOP (Object-Oriented Programming) languages.

The following are some Object-Oriented Programming languages:

  • Java
  • C++
  • Python
  • JavaScript
  • PHP

5. How well do you comprehend Structured Programming?

Structured Programming, a programming paradigm, where the control flow is completely structured. A structure is a block that has set rules and defined control flow, like (else/then/if), (for and while), subroutines, and block structures. Nearly every programming paradigm, including the Object-Oriented Programming model, requires structured programming.

6. Explain inline functions in C++ and C. Give an example of an inline function in C as well.

In C++ or C, an inline function is stated using the keyword “inline”. It fulfills two functions:

  • An inline function is a compiler directive that asks for (but is not required) that the compiler changes the inline function’s body by conducting inline expansion, i.e., placing the function code at the position of every function call, therefore lowering the cost of a function call. In this way, it’s analogous to the register storage class specifier, providing an optimization indicator. Inline functions are typically used to make repeated calls to a similar function.
  • The second objective of the term “inline” is to change link behavior. The C++ or C separate linkage or compilation architecture requires this, particularly since the definition body of the function should be copied in every translation unit where its user permits inlining during compilation, causing a collision at the time of linkage, providing that the function has an external connection. C++ and C handle this in different ways.

The following is an example of an inline function in C:

7. What are C++ Destructors? Also, pen down the C++ syntax for a destructor.

In C++, Destructors are member functions of instances that are summoned as soon as the destruction of an object. A destructor, in other terms, is the final function summoned before the destruction of an object. It is worth mentioning that if an object was created using the keyword “new”, or if the constructor utilized the keyword “new” to assign memory from the free or heap store, the destructor must release the memory with the keyword “delete”.

Destructors are often put to use in order to unassign memory and carry on other cleanups for the sake of a class object as well as its class members as soon as the destruction of the object is destroyed, and they are summoned for a class object when it exits scope or is expressly removed.

In C++, the syntax for destructor is as follows:


8. What exactly is the “finalize” method in Java used for? Also, give an example of how to utilize the “finalize” technique.

The “finalize” function or method is put to use before the destruction of an object in order to perform cleaning actions or unmanaged resources held by the present object. This particular method is only accessed via a derived class or this class since it’s protected.

The finalize method’s syntax is as follows:

protected void finalize throws Throwable{}

The following is an example of how to utilize the finalize method:

public class FinalizeMethodExample {  
    public static void main(String[] args)   
       FinalizeMethodExample o = new FinalizeMethodExample ();   
       o = null;   
       // a call to the garbage collector of Java   
       System.out.println("The end of garbage collection!");   
   protected void finalize()   
       System.out.println("The finalize method is being called now!");   

9. What do you know about C++ or C tokens?

In C++ or C, a token is basically the program’s smallest component that the compilers can comprehend. Tokens may be of the following types:

  • Keywords – “new”, “int”, “class”, etc.
  • Strings – “Jeetu”, “Abhishek”, “Jitendra”, etc.
  • Identifiers – “i”, “j”, “abc”, “temp”, etc.
  • Special Symbols – “\n”, “\r”, “\t”, etc.
  • Constants – 5, 10, 403, etc.
  • Operators – +, – , *, etc

10. Distinguish between an object and a class.

Classes are represented by objects.An object or a blueprint factory is a class.
When you create a class, no memory is assigned. Classes can’t be altered since they are not in memory.Memory is assigned when an object is created. It enables the manipulation of things.
Objects are tangible beings.It’s a logical being.
Each item is connected with its own value sets.The class has no values that may be connected to the field.

11. State a few advantages of a Database Management System.

The following are some of the advantages of a Database Management System:

  • It aids in the management of database redundancy.
  • It restricts unauthorized access.
  • There are several user interfaces available.
  • Services for recovery and backup are available.
  • Limits on integrity are imposed.
  • Make certain that the data is consistent.
  • Simple to reach.
  • Data processing and extraction are simplified due to the use of queries.

12. What are the ACID characteristics of database management systems?

ACID stands for Atomicity(A), Consistency(C), Isolation(I), and Durability(D). A transaction is basically a work’s logical unit that reads and, in some situations, writes to a database. Transactions make use of read and write operations in order to access data. Some attributes must be followed after and before a transaction to maintain database consistency. They are known as ACID properties.

  • Atomicity consists of Abort and Commit.
  • Consistency relates to the accuracy of a database. The total sum after and before the transaction must be kept track of.
  • Isolation property ensures that numerous transactions can occur at the same time without producing database state discrepancies.
  • Durability property guarantees that when the transaction is successful, the database changes and alterations are recorded and written to disk. They are preserved even in the occurrence of a system failure.

13. What do you mean by a checkpoint in relation to database management systems?

In DBMS (Database Management Systems), a checkpoint is a procedure that deletes every previous log from the system and saves them permanently on the storage device. Two ways that can help the Database Management Systems recover and preserve the ACID features include log preservation on every transaction and storing shadow pages. Checkpoints are required when using a log-based recovery method. They are the smallest points from which the database engine is able to recover soon after a crash, as a predetermined smallest point from where the transaction log record may be used to recover every dedicated data up to the crash point.

14. What exactly are Transparent Database Management Systems?

It’s a database management system in which the physical structure is hidden from users. It’s also called Physical Storage Structure, and it refers to the memory manager of a database management system and describes how data is kept on a disc. As a result, there is minor abstraction. Transparencies in the DDBMS (Distributed Database Management Systems) are classified into four types:

  • Performance transparency
  • Transaction transparency
  • Distribution transparency
  • DBMS transparency

15. In the context of SQL, explain unary operations in Relational Algebra.

In Relational Algebra, single operand operations are referred to as unary operations. SELECTION, PROJECTION, and RENAME are said to be unary operations in relational algebra.

  • SELECTION: This action selects a subset of tuples from a relation that fulfills the criteria set. The SELECT procedure is analogous to a filter that maintains only tuples that fulfill a criteria set. Alternatively, this operation may be used to restrict the tuples to those that satisfy the requirement. This operation may alternatively be seen as a horizontal partition of the relation into two groups of tuples: those that satisfy the criteria and are chosen and one that don’t and are refused.
  • PROJECTION: If we think of a relation as a table, the SELECTION operation picks certain rows while rejecting others. In contrast, the PROJECTION procedure selects a subset of the columns of a table while rejecting the remainder. If we just want to look at a handful of relation’s qualities, we can use the PROJECTION operation in order to project the relation over those. Consequently, the PROJECTION operation result may be viewed as a vertical partition of the relation.
  • RENAME: It’s occasionally simple and acceptable to break a complicated chain of actions and rename it as a relation with fresh names. There exist a variety of reasons to rename a relationship, including:
  1. We’ll probably want to preserve the result of a relational algebra expression like a relation to use in the future.
  2. We could desire to bridge connection to itself.

16. Describe the JVM or Java Virtual Machine.

A Java Virtual Machine permits a computer to carry out a Java program. In Java programming, the Java Virtual Machine acts as a run-time engine in which it invokes the primary method. The JVM is a computer system standard that should be executed. Java Virtual Machine converts Java program code to Bytecode, machine-independent and equivalent to native code.

17. In Java, what are the many types of memory spaces assigned by the JVM?

The following are the many types of memory spaces assigned by the JVM:

  • The Class(Method) Area stores per-class structures like the fields, runtime constant pool, method code, and method data 
  • The Java Stack is the place where the frames are kept. It handles partial results and local variables and methods invocation and returns. Every thread has its JVM stack, constructed in parallel with the thread. A fresh frame is produced every time a method is invoked. When the method invocation of a frame is completed, it’s destroyed.
  • The Java Virtual Machine instruction’s address now being executed is recorded in the Programme Counter (PC) register.
  • Heap is the runtime data place where the memory of the object is assigned.
  • Native Method Stack contains each native method put to use in the program.

18. Describe the different types of classloaders in Java.

The Java Virtual Machine’s classloader subsystem is in charge of loading class files. When we run a Java application, the classloader loads it first. Java’s three pre-built classloaders are:

  • ClassLoader in Bootstrap: It’s the superclass of the first classloader, Extension ClassLoader. This loads the rt.jar file, containing every Java Standard Edition class file like, java.lang, java.sql,, and java.util.
  • Extension ClassLoader: It’s the parent of the System ClassLoader as well as the kid of the Bootstrap ClassLoader. The jar files in the path $JAVA HOME/jre/lib/ext are loaded.
  • Application or System ClassLoader: Application or System ClassLoader is the kid classloader of Extension ClassLoader. The classpath is used to load the class files. By default, the classpath is put in the present directory. To change the classpath, you should use the “-classpath” or “cp” options. Another term for its application classloader.

19. What’s the default value of the local variables in Java?

In Java, no default value is assigned to primitives, object references, or local variables. A code snippet to demonstrate this is provided below:

public class LocalVariablesExample{
  public void foo() {
     int localVariable;
     localVariable = localVariable * 10;
     System.out.println("Local Variable value is : " + localVariable);
  public static void main(String args[]) {
     LocalVariablesExample obj = new LocalVariablesExample();;

20. List a few benefits of Java Packages.

These are some of the advantages of Java Packages:

  • Using packages prevents name clashes.
  • It’s much easier to locate the connected classes.
  • The packages simplify access management.
  • Hidden classes are those that are not visible beyond the package but are utilised by it.

21. Compute the total interest on a variety of loans.

There’s no interest till the amount of 1000 is achieved, but the remaining numbers in the array earn a 20% interest rate. In this situation, we’ll construct a function called “totalInterest” that accepts two arguments: the total number of amounts present in the array as well as the array of amounts. For instance, suppose the first input is 4, and the values are 1000, 2000, 3000 and 4,000, the entire interest will be equal to 20% of all the values.

The following is the C++ program code for the aforementioned problem:

using namespace std;
double totalInterest(int totalAmounts, vector<int> a)
   double totalInterestValue = 0;
   for(int i = 0;i < totalAmounts;i ++)
                      if(arr[i] < 1000)continue;
       totalInterestValue = totalInterestValue  + (1.0*(arr[i]-1000)*0.2);
   return totalInterestValue;
int main()
   int totalAmounts;
   cin >> totalAmounts;
   vector<int> a(totalAmounts);
   for(int i = 0; i < totalAmounts; i ++)cin >> a[i];
   cout << totalInterest(totalAmounts, a) << endl;
   return 0;

22. Write code that returns the dissimilarities between the sums of odd and even values in an array of positive integers.

In such a case, we’d need to create a function called “evenOddDiff” that accepts two parameters: the array of positive integers and the total number of positive integers. For instance, if the first three numbers are 7, 4, and 8, the distinction between the sums of odd and even numbers is = (4+8) – (7) = 12 – 7 = 5.

The following is the C++ program code for the aforementioned problem:

using namespace std;
int evenOddDiff(int n, vector<int> &a)
   int oddSum = 0,evenSum = 0;
   for(int i: a)
       if(i & 1)
           oddSum += i;
           evenSum += i;
   return evenSum - oddSum;
int main()
   int n;
   vector<int> a(n);
   for(int j = 0; j < n; j ++)cin >> a[j];
   cout << evenOddDiff(n, a) << endl;
   return 0;

23. Distinguish between Paging and Swapping.

The following are the primary distinctions between Paging and Swapping:

Paging occurs when a portion of a process is shifted to secondary memory.Swapping occurs when the whole process is moved to secondary memory.
Paging converts a contiguous memory block into a non-contiguous but set-size memory block known as a page or a frame.The transient movement of a process from primary memory to secondary memory is referred to as swapping.
Non-contiguous Memory Management is required for paging.Swapping requires no memory management.
Paging doesn’t provide any information on the solution.The instructions for the solution in it are provided by swapping.

24. In the context of Java, what are a Request Dispatcher and a Request Processor?

  • Request Dispatcher: It’s an interface that permits requests inside a program to be routed from a page to another. The page can be a JSP, servlet file, etcm.
  • Request Processor: The struts framework provides a class called Request Processor. It’s responsible for managing requests and answers. It’s the class where we may alter our controller. This has been allowed to conduct out-of-sync requests in a committed thread pool since version 7.16.

25. What do you understand regarding Servlet Collaboration?

The process of communicating information in the company of several servlets of a Java web app is known as servlet collaboration. It enables data to be transmitted from a servlet to another through method invocations. Java’s Servlet Application Programming Interface (API) exposes two interfaces. It’s the primary method for achieving Servlet Collaboration.

26. Describe the many stages of a process.

The following are the various states of a process:

  • New or Created Process: A Created or New process is a program that the operating system will load into the main memory.
  • Ready Process: As soon as a process is formed, it enters the ready state and awaits for the CPU in order to be allotted to it. The OS loads new processes out of secondary memory into main memory.
  • Running Process: Based on the scheduling method, the OS will select any process from the ready state. Consequently, if the system has just one CPU, the total number of processes operating at any time will be one (always). If the system doesn’t have any processor, we can run tasks concurrently.
  • Waiting or Blocked Process: A process can shift to the Wait or Block state from the Running State based on the scheduling technique or the inherent behaviour of the process.
  • Terminated Process: When a process completes its execution, it enters the termination state. The Process Control Block of the process will also be deleted, and the OS terminates the process.

27. In the context of operating systems, elucidate Microkernels.

One among the kernel’s classes is the microkernel. Since it’s a kernel, it handles every system resource. However, with a microkernel, kernel and user services are incorporated in separate address areas. Because user services are placed in the space of the user address, kernel services are located in the kernel address space. The operating system and kernel are smaller. It just offers the most basic memory management and process functions.

The following are some of the advantages of Microkernel:

  • This kernel’s isolated and small architecture allows it to perform better.
  • System expansion is simpler. It’s added simply to the system application without disrupting the kernel.

28. What’s reentrancy in time-sharing systems with multiprogramming?

Reentrancy is a particularly efficient memory-saving approach when it comes to multiprogramming time-sharing systems. It can permit numerous users to exchange a copy (single) of the software simultaneously. Its two primary characteristics are as follows:

  • The software code cannot be modified by itself.
  • Local data for every user process should be kept separately.

29. Describe spoiling in the context of Operating systems.

The practice of storing data temporarily so that it may be processed and used by a device, software, or system is known as spooling. Data is supplied to and stored in memory or several other volatile storages till a computer or program for execution requires it. SPOOL’s full form is “Simultaneous Peripheral Operations Online”. 

It is often stored in physical memory, interrupts or buffers for Output or Input devices on the computer. It is actually the process of gathering data from a large number of Output or Input processes and saving it in a buffer. The buffer is a hard disc or a memory area that Output or Input devices can only access.

30. List the benefits of Multithreaded programming.

These are the benefits of Multithreaded Programming:

  • Increases the system’s responsiveness to consumers.
  • Resources are shared across the process.
  • It’s cost-effective in terms of project resources because parallel processing is performed in some way.
  • It makes full use of the multiprocessing architecture.

Tech Mahindra Behavioral Interview Questions

31. Please tell me a bit about yourself.

Focus on your abilities, traits, experiences, and skills that are relevant to the position you’re applying for. Because TECH MAHINDRA is a top-notch firm, a positive and passionate response that demonstrates you may bring value to their previously formed team is required.

Here’s a sample answer for you:

“I’m a goal-oriented and highly-driven individual who feels that major success in an organization like Tech Mahindra can only be accomplished if everyone on the team works in the same direction. In addition, via prior experiences, I’ve learned and grasped the talents that are well suited to the job description. Adding to that, my previous Manager’s evaluations of my performance demonstrate that I’m an appropriate candidate eager to contribute to a high-achieving and established firm like Tech Mahindra.”

32. What motivates you to work at Tech Mahindra?

The brand attracts and develops the most extraordinary talent by offering comprehensive long-term positions hinged on a digital learning ecosystem available at any time, from any location, and on any smart device. The brand is an excellent location to begin your career as a new worker. It provides an exceptional workplace and friendly setting with a positive atmosphere beneficial to individual and company progress.

33. Why do you think you’re qualified for this position?

When asked questions like this, you must highlight your qualities and talents that are relevant to the role.

Here’s a sample answer for you:

“I’m confident that I’m qualified for this post for a multitude of reasons, most notably my determination to persevere. I’ve all of the necessary talents to prosper in this profession. I’m trying to learn for myself. My abilities and talents perfectly match the needs of this employment. Beyond everything, my leadership and communication abilities qualify me for the post.”

34. Are you comfortable shifting to different parts of India?

Do not respond negatively. If a project, generally, requires you to relocate, you’ll be requested to do so. Inquiring about the projects will be beneficial (always). Prepare to make affirmative responses and express your views to the employer.

35. What do you expect your compensation to be? 

Answering this would be difficult. Most seasoned workers are asked this question. You may inquire about the firm’s average employee raise.

Frequently Asked Questions

36. Are the interview rounds of Tech Mahindra easy?

The response to this depends on the individual and their amount of preparedness. Interview Questions in Tech Mahindra, in general, are believed to be of easy to medium difficulty, and if you’re confident enough in your preparation, you are good to go and not encounter any issues throughout the interview process.

37. Why would someone want to work with Tech Mahindra?

The brand attracts and develops the most extraordinary talent by offering comprehensive long-term positions hinged on a digital learning ecosystem available at any time, from any location, and on any smart device. The brand is an excellent location to begin your career as a new worker. It provides an exceptional workplace and friendly setting with a positive atmosphere beneficial to individual and company progress.

38. How to prepare for Tech Mahindra’s written test examination?

Tech Mahindra’s written test examination comprises mostly 1 written round on English Grammar, Logical Questions, and Quantitative Aptitude, followed by an essay-writing round. The essential theme for preparing for these interview rounds is to practice a large number of questions on the listed topics:

  • Social Media’s impact on today’s youth.
  • Why are today’s teenagers depressed?
  • The Effects of Stress on Youth.

39. Can you tell me anything about Tech Mahindra?

Tech Mahindra is an Indian multinational technology organization specializing in BPO (Business Process Outsourcing) and IT (Information Technology). The firm is Mahindra Group’s subsidiary and is headquartered in Pune, and Mumbai is its registered office. The brand is a $5.2 billion corporation in the US as of April 2020, with over one lakh employees in 90 countries. In the 2019 Fortune India 500 list, the firm was rated fifth in India’s IT organizations and 47th overall. On 25 June 2013, the brand announced the completion of a tie-up with Mahindra Satyam. The firm had over 900 active clients as of April 2020.

Being linked with Tech Mahindra just not ensures that you’re on the correct track; it also enables you to gain some job security. Tech Mahindra can aid you in advancing your job career while permitting you to maintain a good work and life balance.

40. What’s the starting wage for freshers at Tech Mahindra?

In India, the typical compensation for Software Development Engineer (Fresher) at Tech Mahindra is roughly ₹3.5 lakhs per year.

41. How long does the hiring process at Tech Mahindratake?

The hiring process at Tech Mahindra typically lasts for 2 to 3 months, depending on the availability of candidates and interviewers.

42. Could you please tell me what your strengths and weaknesses are?

It’s one of the commonly asked questions in HR interviews. Your response to this question must not appear overconfident. Simultaneously, dealing with faults doesn’t appear to be untrustworthy. To be honest, it’s always an excellent habit. Some of the benefits that might be addressed during the interview are:

  • I’m a team player dedicated to learning new things each day.
  • I’ve excellent communication abilities.
  • My capacity to handle pressure and remain cool in challenging times distinguishes me.
  • I’ve strong leadership abilities, which may benefit me in the future.

Let’s now look at some of the flaws that can be addressed in the interview:

  • When I’m unfamiliar with a new situation or technology, I frequently experience self-doubt.
  • I’m critical of myself.
  • I’m afraid of performing on stage (stage fear while speaking in front of a massive audience).

It’s essential to confess mistakes, but it’s equally necessary to describe how you carried them when it comes to remedying them. It’ll give the interviewer the idea that you’re continually striving to improve.

43. Why do you think you’re qualified for this position?

When asked questions like this, you must highlight your qualities and talents that are relevant to the role.

Here’s a sample answer for you:

“I’m confident that I’m qualified for this post for a multitude of reasons, most notably my determination to persevere. I’ve all of the necessary talents to prosper in this profession. I’m trying to learn for myself. My abilities and talents perfectly match the needs of this employment. Beyond everything, my leadership and communication abilities qualify me for the post.”

44. What motivates you to change jobs?

It’s a common question among experienced workers searching for a new challenge. The simplest response to this is that you’re quitting your present work in order to pursue a job promotion. Make a point of not criticizing or speaking adversely about your present recruiter.

45. What are Tech Mahindra’s recruiter policies?

Tech Mahindra’s recruitment policies are as follows:

  • If an applicant has sat an interview within the previous six months of the date of a new application, they are unable to apply until the 6-month term is finished.
  • If a candidate is denied in an interview with Tech Mahindra, they will be unqualified to apply for 6 months.
  • If Tech Mahindra plans to reject a candidate’s application for whatever reason, the candidate is unqualified to apply.
  • If a candidate isn’t able to provide an interview soon after applying to Tech Mahindra, the individual has the opportunity to resubmit and take part in the selection process.
Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar

Subscribe to Newsletter

Stay ahead of the rapidly evolving world of technology with our news letters. Subscribe now!