PapersAdda

Tech Mahindra Interview Questions 2026

24 min read
Interview Questions
Advertisement Placement

Tech Mahindra Interview Questions 2026 (with Answers for Freshers)

Last Updated: March 2026


About Tech Mahindra

Tech Mahindra is an Indian multinational IT services and consulting company, part of the Mahindra Group. With over 150,000 employees across 90 countries, Tech Mahindra is a leading provider of digital transformation, consulting, and business re-engineering services. The company is particularly strong in telecommunications, manufacturing, and BFSI verticals. Known for its 'Connected World, Connected Experiences' vision, Tech Mahindra emphasizes sustainability, diversity, and creating value for all stakeholders.


Tech Mahindra Selection Process Overview

RoundDescriptionDurationKey Focus Areas
Round 1: English EssayWritten communication test15 minsGrammar, Vocabulary, Coherence
Round 2: Online TestAptitude + Technical MCQs90 minsQuantitative, Logical, Verbal, Technical
Round 3: Technical InterviewTechnical assessment30-40 minsProgramming, CS Concepts, Projects
Round 4: HR InterviewFinal screening15-20 minsCommunication, Personality, Expectations

HR Interview Questions with Answers

Q1: Why Tech Mahindra?

Q2: What do you know about the Mahindra Group?

Key Companies:

  • Mahindra & Mahindra: Leading SUV and tractor manufacturer
  • Tech Mahindra: IT services and consulting (where I'd be joining)
  • Mahindra Finance: Rural financing and lending
  • Mahindra Lifespaces: Real estate development
  • Mahindra Holidays: Vacation ownership and resorts
  • Ssamay: Part of the technology and business services ecosystem

Core Values:

  • Rise philosophy: Accept no limits, alternative thinking, drive positive change
  • Ethics and integrity in all dealings
  • Sustainability and stakeholder value creation

Connection to Tech Mahindra: Being part of the Mahindra Group gives Tech Mahindra access to diverse industry expertise, a strong ethical foundation, and the 'Rise' culture that encourages employees to push boundaries. This ecosystem creates unique opportunities for cross-industry learning and innovation."

Q3: How do you handle working under pressure?

Q4: Describe a time you had to adapt to change quickly.

Q5: What are your strengths and how do they benefit a team?

Q6: How do you prioritize multiple competing tasks?

Q7: Tell me about a time you received negative feedback.

Q8: What motivates you in your work?

Q9: How do you ensure quality in your deliverables?

Q10: Where do you see yourself in the next 3-5 years?


Technical Interview Questions with Answers

Q1: Write a program to check if a number is Armstrong.

public class ArmstrongNumber {
    // Check if number is Armstrong
    public static boolean isArmstrong(int number) {
        int originalNumber = number;
        int sum = 0;
        int digits = String.valueOf(number).length();
        
        while (number > 0) {
            int digit = number % 10;
            sum += Math.pow(digit, digits);
            number /= 10;
        }
        
        return sum == originalNumber;
    }
    
    // Alternative without converting to string
    public static boolean isArmstrongV2(int number) {
        int originalNumber = number;
        int sum = 0;
        int temp = number;
        int digits = 0;
        
        // Count digits
        while (temp > 0) {
            digits++;
            temp /= 10;
        }
        
        temp = number;
        // Calculate sum of digits raised to power
        while (temp > 0) {
            int digit = temp % 10;
            int power = 1;
            for (int i = 0; i < digits; i++) {
                power *= digit;
            }
            sum += power;
            temp /= 10;
        }
        
        return sum == originalNumber;
    }
    
    public static void main(String[] args) {
        System.out.println(isArmstrong(153));  // true (1³ + 5³ + 3³ = 153)
        System.out.println(isArmstrong(370));  // true
        System.out.println(isArmstrong(123));  // false
    }
}

Armstrong Number: A number equal to the sum of its digits raised to the power of number of digits. Examples: 153 (1³+5³+3³=153), 370, 371, 407

Q2: What is the difference between C and Java?

Key Differences:

  • C is compiled directly to machine code; Java compiles to bytecode run by JVM
  • C requires manual malloc/free; Java has automatic garbage collection
  • C allows direct memory manipulation; Java provides memory safety
  • C is better for low-level programming; Java excels in enterprise applications

Similarities: Both have similar syntax, support functions, loops, and conditional statements."

Q3: Write a SQL query to find duplicate email addresses.

-- Find duplicates with count
SELECT email, COUNT(*) as occurrence
FROM users
GROUP BY email
HAVING COUNT(*) > 1;

-- Find all records that have duplicates
SELECT u1.*
FROM users u1
JOIN (
    SELECT email
    FROM users
    GROUP BY email
    HAVING COUNT(*) > 1
) u2 ON u1.email = u2.email
ORDER BY u1.email;

-- Delete duplicates keeping one (MySQL)
DELETE u1 FROM users u1
JOIN users u2 
WHERE u1.id > u2.id AND u1.email = u2.email;

-- Using ROW_NUMBER to identify duplicates (Standard SQL)
WITH RankedUsers AS (
    SELECT *,
        ROW_NUMBER() OVER (PARTITION BY email ORDER BY id) as rn
    FROM users
)
SELECT * FROM RankedUsers WHERE rn > 1;

-- Delete using ROW_NUMBER
WITH RankedUsers AS (
    SELECT *,
        ROW_NUMBER() OVER (PARTITION BY email ORDER BY id) as rn
    FROM users
)
DELETE FROM users WHERE id IN (
    SELECT id FROM RankedUsers WHERE rn > 1
);

HAVING clause filters groups after aggregation, unlike WHERE which filters rows before aggregation.

Q4: Explain the difference between while and do-while loops.

while (condition) {
    // Body executes only if condition is true
    // May execute zero or more times
}

// Example
int i = 0;
while (i < 5) {
    System.out.println(i);
    i++;
}

do-while loop: Executes body first, then checks condition.

do {
    // Body executes at least once
    // Then checks condition
} while (condition);

// Example
int i = 0;
do {
    System.out.println(i);
    i++;
} while (i < 5);

Key Differences:

Featurewhiledo-while
Condition CheckBefore executionAfter execution
Minimum Executions01
Use CaseWhen execution is conditionalWhen at least one execution required
Syntaxwhile (condition) { }do { } while (condition);
SemicolonNo semicolon after whileSemicolon required after while

When to use do-while: Menu systems, input validation where you need at least one prompt.

// Input validation example
do {
    System.out.print("Enter positive number: ");
    num = scanner.nextInt();
} while (num <= 0);

Best Practice: Use while when zero iterations are possible; use do-while when at least one iteration is required."

Q5: Write a program to find the GCD (Greatest Common Divisor) of two numbers.

public class GCD {
    // Euclidean algorithm - iterative
    public static int gcdIterative(int a, int b) {
        a = Math.abs(a);
        b = Math.abs(b);
        
        while (b != 0) {
            int temp = b;
            b = a % b;
            a = temp;
        }
        return a;
    }
    
    // Euclidean algorithm - recursive
    public static int gcdRecursive(int a, int b) {
        a = Math.abs(a);
        b = Math.abs(b);
        
        if (b == 0) {
            return a;
        }
        return gcdRecursive(b, a % b);
    }
    
    // Using Java's built-in method (Java 18+)
    public static int gcdBuiltIn(int a, int b) {
        return java.math.BigInteger.valueOf(a)
            .gcd(java.math.BigInteger.valueOf(b))
            .intValue();
    }
    
    // LCM using GCD
    public static int lcm(int a, int b) {
        return Math.abs(a * b) / gcdIterative(a, b);
    }
    
    public static void main(String[] args) {
        int a = 48, b = 18;
        System.out.println("GCD of " + a + " and " + b + " is: " + 
                          gcdIterative(a, b)); // 6
        System.out.println("LCM is: " + lcm(a, b)); // 144
    }
}

Euclidean Algorithm: GCD(a, b) = GCD(b, a mod b), until b becomes 0.

Time Complexity: O(log(min(a, b))) Space Complexity: O(1) iterative, O(log(min(a, b))) recursive

Q6: What is the difference between break and continue statements?

for (int i = 0; i < 10; i++) {
    if (i == 5) {
        break; // Exit loop completely
    }
    System.out.print(i + " "); // Prints: 0 1 2 3 4
}

continue: Skips current iteration and moves to next.

for (int i = 0; i < 10; i++) {
    if (i % 2 == 0) {
        continue; // Skip even numbers
    }
    System.out.print(i + " "); // Prints: 1 3 5 7 9
}

Labeled break (for nested loops):

outer: for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
        if (i == 1 && j == 1) {
            break outer; // Breaks outer loop
        }
        System.out.println(i + "," + j);
    }
}

Comparison:

Aspectbreakcontinue
ActionExit loop/switchSkip to next iteration
Loop ExecutionStops completelyContinues with next iteration
Use in switchYesNo
LabeledYes (for nested)Yes (for nested)

Best Practice: Use sparingly; they can make code harder to follow if overused."

Q7: Write a program to find the sum of digits of a number.

public class SumOfDigits {
    // Iterative approach
    public static int sumOfDigits(int number) {
        number = Math.abs(number); // Handle negative numbers
        int sum = 0;
        
        while (number > 0) {
            sum += number % 10;  // Get last digit
            number /= 10;        // Remove last digit
        }
        
        return sum;
    }
    
    // Recursive approach
    public static int sumOfDigitsRecursive(int number) {
        number = Math.abs(number);
        
        if (number == 0) {
            return 0;
        }
        
        return (number % 10) + sumOfDigitsRecursive(number / 10);
    }
    
    // Sum until single digit (digital root)
    public static int digitalRoot(int number) {
        if (number == 0) return 0;
        if (number % 9 == 0) return 9;
        return number % 9;
    }
    
    public static void main(String[] args) {
        int num = 12345;
        System.out.println("Sum of digits of " + num + ": " + 
                          sumOfDigits(num)); // 15
        System.out.println("Digital root: " + digitalRoot(num)); // 6
    }
}

Digital Root: Single digit obtained by repeatedly summing digits until one digit remains. Formula: 1 + (n - 1) % 9 for non-zero numbers.

Time Complexity: O(log n) - number of digits Space Complexity: O(1) iterative, O(log n) recursive

Q8: Explain the difference between call by value and call by reference.

  • Changes to parameter don't affect original variable
  • Used by Java for primitive types
void modify(int x) {
    x = 100; // Modifies copy only
}

int a = 50;
modify(a);
System.out.println(a); // Still 50

Call by Reference: Passes the memory address of the variable.

  • Changes to parameter affect original variable
  • Java doesn't support true call by reference
  • Java uses call by value for object references (reference value is copied)
void modifyObject(Person p) {
    p.name = "New Name"; // Modifies object (same reference)
}

void reassign(Person p) {
    p = new Person(); // Reassigns local copy only
}

Person person = new Person("John");
modifyObject(person); // Changes person's name
reassign(person);     // No effect on original reference

Java's Approach: Java is strictly call by value:

  • For primitives: value is copied
  • For objects: reference value is copied (object itself is not)

Key Point: In Java, you cannot write a method that swaps two integers because the method receives copies. But you can modify object's internal state because both references point to same object."

Q9: Write a program to print a pattern (pyramid).

public class PatternPrinting {
    // Pyramid pattern
    public static void printPyramid(int n) {
        for (int i = 1; i <= n; i++) {
            // Print spaces
            for (int j = 1; j <= n - i; j++) {
                System.out.print(" ");
            }
            // Print stars
            for (int k = 1; k <= 2 * i - 1; k++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
    
    // Number pyramid
    public static void printNumberPyramid(int n) {
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n - i; j++) {
                System.out.print(" ");
            }
            for (int k = 1; k <= i; k++) {
                System.out.print(k + " ");
            }
            System.out.println();
        }
    }
    
    // Inverted pyramid
    public static void printInvertedPyramid(int n) {
        for (int i = n; i >= 1; i--) {
            for (int j = 1; j <= n - i; j++) {
                System.out.print(" ");
            }
            for (int k = 1; k <= 2 * i - 1; k++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
    
    // Diamond pattern
    public static void printDiamond(int n) {
        // Upper half
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n - i; j++) System.out.print(" ");
            for (int k = 1; k <= 2 * i - 1; k++) System.out.print("*");
            System.out.println();
        }
        // Lower half
        for (int i = n - 1; i >= 1; i--) {
            for (int j = 1; j <= n - i; j++) System.out.print(" ");
            for (int k = 1; k <= 2 * i - 1; k++) System.out.print("*");
            System.out.println();
        }
    }
    
    public static void main(String[] args) {
        System.out.println("Pyramid:");
        printPyramid(5);
        
        System.out.println("\nNumber Pyramid:");
        printNumberPyramid(5);
    }
}

Pattern Logic: Use nested loops - outer loop for rows, inner loops for spaces and characters. Calculate pattern based on row number.

Q10: What is the difference between static and non-static methods?

class MathUtils {
    static int add(int a, int b) {
        return a + b;
    }
}

// Call without creating object
int result = MathUtils.add(5, 3);
  • No access to instance variables or methods
  • Cannot use 'this' keyword
  • Called using ClassName.method()

Non-Static Methods: Belong to object instance.

class Person {
    String name;
    
    void greet() {
        System.out.println("Hello, " + this.name);
    }
}

// Call on object instance
Person p = new Person();
p.name = "John";
p.greet(); // Hello, John
  • Can access instance and static members
  • Can use 'this' keyword
  • Called on object reference

Comparison:

FeatureStaticNon-Static
Belongs toClassObject
MemorySingle copySeparate copy per object
Access to instance varsNoYes
Access to static varsYesYes
Keyword 'this'NoYes
Call syntaxClassName.method()object.method()
Use caseUtility methodsObject behavior

Static Block: Executes when class loads, before main method.

static {
    // Initialization code
}

Best Practice: Use static for utility functions; avoid for state that varies by instance."


Managerial/Behavioral Questions with Answers

Q1: How would you handle a conflict with your team lead?

Q2: Describe a situation where you had to meet a very tight deadline.

Q3: How do you approach learning a new technology or tool?

Q4: Tell me about a time you improved a process or system.

Q5: What would you do if you disagreed with a company policy?


Tips for Cracking Tech Mahindra Interview

  1. English Essay Writing: The essay round is the first filter. Practice writing coherent 150-200 word essays on general topics. Focus on grammar, structure, and clear expression.

  2. Know Mahindra Group: Understand the connection to the larger Mahindra Group and the 'Rise' philosophy. Show appreciation for the conglomerate's values.

  3. Telecommunications Knowledge: Tech Mahindra is strong in telecom. Basic awareness of 5G, IoT, and network technologies can be advantageous.

  4. Practice Coding Basics: Be comfortable with pattern printing, number programs (prime, Armstrong, Fibonacci), and array manipulation.

  5. Pseudo Code Skills: Be ready to write pseudo code showing logic without worrying about syntax.

  6. Aptitude Preparation: Practice quantitative, logical reasoning, and verbal ability regularly.

  7. Project Preparation: Know your academic projects thoroughly - be ready to explain architecture and your contributions.

  8. Communication Clarity: Tech Mahindra values clear communication. Practice explaining technical concepts simply.

  9. Show Enthusiasm: Demonstrate genuine interest in joining the organization and the Mahindra Group.

  10. Stay Calm: The interview process is straightforward. Stay calm, be yourself, and answer honestly.


Frequently Asked Questions (FAQs)

Q1: What is the salary package for freshers at Tech Mahindra? A: Typically ranges from 3.5 LPA to 4.5 LPA for fresh graduates, depending on performance in assessments and interview.

Q2: Is there a service bond at Tech Mahindra? A: Yes, typically a 1-year service agreement. Specific terms are provided in the offer letter.

Q3: What topics are given for the essay writing round? A: Topics are usually general - technology trends, current affairs, social issues, or abstract topics. Practice writing structured essays with introduction, body, and conclusion.

Q4: Does Tech Mahindra ask coding questions in the interview? A: Yes, expect basic programming questions, pattern printing, number programs, and pseudo code writing.

Q5: What is the training period at Tech Mahindra? A: Initial training typically lasts 3-6 months covering technical skills, domain basics, and company processes.


Best of luck with your Tech Mahindra interview preparation!

Advertisement Placement

Explore this topic cluster

More resources in Interview Questions

Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.

More in Interview Questions

More from PapersAdda

Share this article: