# Tech Mahindra Interview Questions with Answers

8 previously-asked interview questions from Tech Mahindra's hiring process, each with the correct answer and a worked explanation. Written against the company's actual test pattern.

_Source: Astra (https://useastra.in). Updated 2026-09-05._

### 1. What is the difference between an interface and an abstract class?

**Answer:** An abstract class can have both implemented and abstract methods and holds state, and a class extends only one. An interface traditionally declares method signatures only (though modern languages allow default methods) and a class can implement many. Use an interface for a contract, an abstract class for shared base behaviour.

**Explanation:** Abstract class: partial implementation, single. Interface: contract, multiple.

### 2. What is the difference between primary and secondary memory?

**Answer:** Primary memory (RAM) is fast, volatile, and directly accessible by the CPU for running programs. Secondary memory (hard disk, SSD) is slower, non-volatile, larger, and used for permanent storage. Data moves from secondary to primary to be processed.

**Explanation:** Primary: fast volatile RAM. Secondary: slow non-volatile storage.

### 3. What is a join in SQL?

**Answer:** A join combines rows from two or more tables based on a related column. Types include inner join (matches only), left and right outer joins (all rows from one side plus matches), and full outer join (all rows from both).

**Explanation:** Combine tables on a related column; several join types.

### 4. What is polymorphism? Give an example.

**Answer:** Polymorphism means one interface with many forms. Compile time polymorphism is method overloading; runtime polymorphism is overriding, for example a base class Animal with a sound method overridden by Dog and Cat to bark or meow.

**Explanation:** One interface, many forms; overloading and overriding.

### 5. What is a null pointer?

**Answer:** A null pointer is a pointer that does not point to any valid memory location, usually represented by the value 0 or NULL. It signals the absence of a target; dereferencing it leads to undefined behaviour, so always check before use.

**Explanation:** A pointer pointing to nothing; do not dereference it.

### 6. What is the difference between static and dynamic memory allocation?

**Answer:** Static allocation reserves memory at compile time with a fixed size (for example global and local variables), managed automatically. Dynamic allocation reserves memory at runtime from the heap (for example malloc or new), gives flexible size, and must be freed manually to avoid leaks.

**Explanation:** Static: compile time, fixed. Dynamic: runtime, heap, manual free.

### 7. Tell me about yourself.

**Answer:** Give a concise 60 to 90 second overview: your degree, key skills, a project or internship with its impact, and why Tech Mahindra interests you. Keep it structured and relevant.

**Explanation:** Structured pitch: background, skills, project, fit.

### 8. Why do you want to join Tech Mahindra?

**Answer:** Mention Tech Mahindra strength in telecom and digital transformation, its global client base, learning programs for freshers, and growth opportunities. Connect it to your interests and career goals.

**Explanation:** Telecom and digital strength, clients, training, growth.

More Tech Mahindra preparation, including the full recruitment process: https://useastra.in/campus/tech-mahindra
