# Tech Mahindra Core CS Questions with Answers

8 previously-asked core cs 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 smallest unit of data in a computer?

A. Bit
B. Byte
C. Nibble
D. Word

**Answer:** Bit

**Explanation:** A bit (0 or 1) is the smallest unit of data; a byte is 8 bits.

### 2. Which SQL command is used to give access permissions to a user?

A. GRANT
B. COMMIT
C. SELECT
D. ALTER

**Answer:** GRANT

**Explanation:** GRANT is a Data Control Language command that gives privileges to users.

### 3. Which sorting algorithm uses the divide and conquer strategy?

A. Bubble sort
B. Merge sort
C. Selection sort
D. Insertion sort

**Answer:** Merge sort

**Explanation:** Merge sort divides the array, sorts each half, and merges them, which is divide and conquer.

### 4. What is the return type of a constructor in most OOP languages?

A. No return type
B. void
C. int
D. Same as the class

**Answer:** No return type

**Explanation:** A constructor has no return type at all, not even void.

### 5. Which algorithm is used for deadlock avoidance in operating systems?

A. Bankers algorithm
B. Round Robin
C. FCFS
D. Paging

**Answer:** Bankers algorithm

**Explanation:** The Bankers algorithm checks whether granting a resource keeps the system in a safe state, avoiding deadlock.

### 6. A router primarily operates at which OSI layer?

A. Physical
B. Data Link
C. Network
D. Transport

**Answer:** Network

**Explanation:** A router forwards packets using IP addresses at the network layer.

### 7. In C, what is the result of the integer division 5 / 2?

A. 2
B. 2.5
C. 3
D. 0

**Answer:** 2

**Explanation:** Integer division discards the fractional part, so 5 / 2 is 2.

### 8. Which normal form requires that all column values be atomic (indivisible)?

A. 1NF
B. 2NF
C. 3NF
D. BCNF

**Answer:** 1NF

**Explanation:** First Normal Form requires atomic values with no repeating groups.

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