Tech Mahindra is a leading provider of digital transformation, consulting, and business reengineering services. The company operates in over 90 countries and has a global workforce of over 138,000 professionals. As one of the largest recruiters in the IT industry, Tech Mahindra conducts placement exams to recruit the best and brightest candidates for their organization.
To crack the Tech Mahindra placement exam, it is important to understand the exam pattern, syllabus, and types of questions that are typically asked. It is also recommended to practice with mock tests and solve previous year's question papers to get a feel for the exam format.
In addition, it is crucial to follow best practices when preparing for the Tech Mahindra placement exam. These include setting a study schedule, taking breaks, staying organized, and getting enough sleep. It is also important to seek advice and guidance from experienced professionals and peers who have taken the exam before.
As with any exam, cheating is not only unethical but also counterproductive. It is not recommended to resort to cheating as it can lead to serious consequences and tarnish your reputation in the industry. Instead, focus on honing your skills and knowledge to crack the Tech Mahindra placement exam on your own merit.
To be eligible for the Tech Mahindra placement exam, you must meet the following academic qualifications:
Additionally, you must be from a full-time degree course recognized by the Central/State Government of India, with no more than 1 year of education gap. All pending backlogs must be cleared at the time of the Tech Mahindra selection process.
We also have exciting packages for you to avail. If you clear Round 1 i.e., Aptitude + Essay Test only you will be offered a package of 3.25 LPA. But if you want to be eligible for a package of 5.5 LPA, you will have to clear Round 2 i.e., Coding.
But that's not all! If you're selected for the Tech Mahindra placement exam, you'll have the opportunity to work with one of the leading technology companies in India and gain hands-on experience in a competitive and high-pressure environment. You'll also have the chance to network with industry professionals and experts, learn about the latest technologies and techniques used in the industry, and potentially kickstart a successful career in the technology industry.
Please note that, Students who have participated in Tech Mahindra Interview process in the last 6 months are not eligible for Tech Mahindra selection process. So, don't wait any longer, apply now and take the first step towards achieving your career goals with Tech Mahindra!
Quantitative Aptitude:
Logical Reasoning:
Tech Test:
English - Verbal:
Round 1: Online Test
Round 2: Technical Test
Round 3: Conversational Test
Round 4: Interview Rounds
Note:
Section Name: Aptitude Test
Subjects:
English Essay:
Section Name: Technical Test
Subjects:
Note: The time allotted for the test is subject to change as per the discretion of the company.
Note: The selection process may vary depending on the role and location. The company reserves the right to add or remove stages as per the requirement.
#Question 1
Develop a function that takes in an array of positive integers and a starting position as input, and returns the sum of absolute differences between adjacent numbers, starting from the specified position.
#Question 1
Write a Java program to implement a circular buffer using an array. The buffer should have a fixed size and should be able to add and remove elements in a circular fashion.
#Solution 1
```sh
class CircularBuffer {
private int[] buffer;
private int size;
private int head = 0;
private int tail = 0;
public CircularBuffer(int size) {
this.size = size;
buffer = new int[size];
}
public void add(int value) {
if (head == (tail + 1) % size) {
throw new IllegalStateException("Buffer is full");
}
buffer[tail] = value;
tail = (tail + 1) % size;
}
public int remove() {
if (head == tail) {
throw new IllegalStateException("Buffer is empty");
}
int value = buffer[head];
head = (head + 1) % size;
return value;
}
}
```
#Question 2
Create a function that takes in the number of cloth pieces and the desired length of each clothing piece (10 feet) as input, and calculates the total number of clothing pieces that can be extracted from the given number of cloth pieces.
#Question 2
Write a Java program to implement a thread-safe LRU cache using a HashMap and a LinkedList. The cache should have a fixed size and should automatically remove the least recently used element when it becomes full.
#Solution 2
```sh
import java.util.LinkedHashMap;
import java.util.Map;
class LRUCache<K, V> {
private final int maxSize;
private final Map<K, V> cache;
public LRUCache(final int maxSize) {
this.maxSize = maxSize;
this.cache = new LinkedHashMap<K, V>(maxSize * 4 / 3, 0.75f, true) {
@Override
protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
return size() > maxSize;
}
};
}
public synchronized V get(K key) {
return cache.get(key);
}
public synchronized void put(K key, V value) {
cache.put(key, value);
}
}
```
#Question 3
Create a function that takes in an array of loan amounts and calculates the total interest on the loans, considering that no interest is applied on loans up to 2000 and a 20% interest is applied on remaining amounts in the array.
#Question 3
Write a Java program to implement a Bloom filter using a bit array and multiple hash functions. The Bloom filter should have a fixed size and should be able to add and check for the presence of elements efficiently.
#Answer 3
import java.util.BitSet;
import java.util.HashMap;
import java.util.Map;
class BloomFilter {
private BitSet bitset;
private int size;
private Map<Integer, Integer> hashFunctions;
public BloomFilter(int size) {
this.size = size;
this.bitset = new BitSet(size);
this.hashFunctions = new HashMap<>();
hashFunctions.put(1, 7);
hashFunctions.put(2, 11);
hashFunctions.put(3, 13);
}
public void add(String value) {
for (Integer key : hashFunctions.keySet()) {
int index = Math.abs(value.hashCode() * key) % size;
bitset.set(index, true);
}
}
public boolean check(String value) {
for (
#Question 4
Write a Java program to implement a thread-safe Singleton class using the double-checked locking mechanism.
#Answer 4
```sh
class Singleton {
private static volatile Singleton instance;
private Singleton() { }
public static Singleton getInstance() {
if (instance == null) {
synchronized (Singleton.class) {
if (instance == null) {
instance = new Singleton();
}
}
}
return instance;
}
}
```
#Question 5
Write a Java program to implement a generic tree data structure using classes and interfaces. The tree should support basic operations such as adding and removing nodes, and traversing the tree in pre-order, in-order, and post-order.
#Solution 5
```sh
interface Tree<T> {
public void addNode(T value);
public void removeNode(T value);
public void preOrderTraversal();
public void inOrderTraversal();
public void postOrderTraversal();
}
class TreeNode<T> {
T value;
List<TreeNode<T>> children;
public TreeNode(T value) {
this.value = value;
children = new ArrayList<TreeNode<T>>();
}
}
class GenericTree<T> implements Tree<T> {
private TreeNode<T> root;
// implements addNode, removeNode, preOrderTraversal, inOrderTraversal, postOrderTraversal methods
}
```
#Question 1
Develop a function that takes in an array of positive integers and a starting position as input, and returns the sum of absolute differences between adjacent numbers, starting from the specified position.
#Question 1
Write a Java program to implement a circular buffer using an array. The buffer should have a fixed size and should be able to add and remove elements in a circular fashion.
#Solution 1
```sh
class CircularBuffer {
private int[] buffer;
private int size;
private int head = 0;
private int tail = 0;
public CircularBuffer(int size) {
this.size = size;
buffer = new int[size];
}
public void add(int value) {
if (head == (tail + 1) % size) {
throw new IllegalStateException("Buffer is full");
}
buffer[tail] = value;
tail = (tail + 1) % size;
}
public int remove() {
if (head == tail) {
throw new IllegalStateException("Buffer is empty");
}
int value = buffer[head];
head = (head + 1) % size;
return value;
}
}
```
#Question 2
Create a function that takes in the number of cloth pieces and the desired length of each clothing piece (10 feet) as input, and calculates the total number of clothing pieces that can be extracted from the given number of cloth pieces.
#Question 2
Write a Java program to implement a thread-safe LRU cache using a HashMap and a LinkedList. The cache should have a fixed size and should automatically remove the least recently used element when it becomes full.
#Solution 2
```sh
import java.util.LinkedHashMap;
import java.util.Map;
class LRUCache<K, V> {
private final int maxSize;
private final Map<K, V> cache;
public LRUCache(final int maxSize) {
this.maxSize = maxSize;
this.cache = new LinkedHashMap<K, V>(maxSize * 4 / 3, 0.75f, true) {
@Override
protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
return size() > maxSize;
}
};
}
public synchronized V get(K key) {
return cache.get(key);
}
public synchronized void put(K key, V value) {
cache.put(key, value);
}
}
```
#Question 3
Create a function that takes in an array of loan amounts and calculates the total interest on the loans, considering that no interest is applied on loans up to 2000 and a 20% interest is applied on remaining amounts in the array.
#Question 3
Write a Java program to implement a Bloom filter using a bit array and multiple hash functions. The Bloom filter should have a fixed size and should be able to add and check for the presence of elements efficiently.
#Answer 3
import java.util.BitSet;
import java.util.HashMap;
import java.util.Map;
class BloomFilter {
private BitSet bitset;
private int size;
private Map<Integer, Integer> hashFunctions;
public BloomFilter(int size) {
this.size = size;
this.bitset = new BitSet(size);
this.hashFunctions = new HashMap<>();
hashFunctions.put(1, 7);
hashFunctions.put(2, 11);
hashFunctions.put(3, 13);
}
public void add(String value) {
for (Integer key : hashFunctions.keySet()) {
int index = Math.abs(value.hashCode() * key) % size;
bitset.set(index, true);
}
}
public boolean check(String value) {
for (
#Question 4
Write a Java program to implement a thread-safe Singleton class using the double-checked locking mechanism.
#Answer 4
```sh
class Singleton {
private static volatile Singleton instance;
private Singleton() { }
public static Singleton getInstance() {
if (instance == null) {
synchronized (Singleton.class) {
if (instance == null) {
instance = new Singleton();
}
}
}
return instance;
}
}
```
#Question 5
Write a Java program to implement a generic tree data structure using classes and interfaces. The tree should support basic operations such as adding and removing nodes, and traversing the tree in pre-order, in-order, and post-order.
#Solution 5
```sh
interface Tree<T> {
public void addNode(T value);
public void removeNode(T value);
public void preOrderTraversal();
public void inOrderTraversal();
public void postOrderTraversal();
}
class TreeNode<T> {
T value;
List<TreeNode<T>> children;
public TreeNode(T value) {
this.value = value;
children = new ArrayList<TreeNode<T>>();
}
}
class GenericTree<T> implements Tree<T> {
private TreeNode<T> root;
// implements addNode, removeNode, preOrderTraversal, inOrderTraversal, postOrderTraversal methods
}
```
I liked the assessment facility offered by Edyst, using this feature I prepared for all the competitive companies where Computer Science graduates get placement. As a CS background student Edyst platform helped me a lot to furnish my coding skills. It helped me to perform upto my true potential during my placement exams.
I joined Edust because the platform has wide range of practice questions. Also, there was mentors support throughout the day to help students when they get stuck. All the mentors were very friendly and helpful, the chat support feature of Edyst is best.
Daily coding challenge and the doubt session helped me in staying consistent. Also, the leadership board kept me motivated. Edyst gave me the best guiding materials for all the cohorts I joined. I like everything done by Edyst for my success.
Initially, I had 0 experience in coding as I'm a mechanical student; then I came across Edyst, which took me from 0 to 1 in coding. Edyst helped me to understand things better and easier. The sessions were excellent and very helpful. The best part of their courses was the assignments; they were accommodating, and the mentors were too kind to help me even at midnight.
I wanted video lectures along with the coding assessments and that is exactly what Edyst offered me. I also got the roadmap towards getting a good placement job, I can't thanks Edyst enough for my success.
I really like the Company specific practice questions they turn out to be super helpfulduring my interview, I didn't face any difficulty, the variety and range of practice questions (especially on arrays) got me my dream job. Also, the online live session were very interactive and helped me in revision and solving doubts. Thank you Edyst.
#Question 1
Develop a function that takes in an array of positive integers and a starting position as input, and returns the sum of absolute differences between adjacent numbers, starting from the specified position.
#Question 1
Write a Java program to implement a circular buffer using an array. The buffer should have a fixed size and should be able to add and remove elements in a circular fashion.
#Solution 1
```sh
class CircularBuffer {
private int[] buffer;
private int size;
private int head = 0;
private int tail = 0;
public CircularBuffer(int size) {
this.size = size;
buffer = new int[size];
}
public void add(int value) {
if (head == (tail + 1) % size) {
throw new IllegalStateException("Buffer is full");
}
buffer[tail] = value;
tail = (tail + 1) % size;
}
public int remove() {
if (head == tail) {
throw new IllegalStateException("Buffer is empty");
}
int value = buffer[head];
head = (head + 1) % size;
return value;
}
}
```
#Question 2
Create a function that takes in the number of cloth pieces and the desired length of each clothing piece (10 feet) as input, and calculates the total number of clothing pieces that can be extracted from the given number of cloth pieces.
#Question 2
Write a Java program to implement a thread-safe LRU cache using a HashMap and a LinkedList. The cache should have a fixed size and should automatically remove the least recently used element when it becomes full.
#Solution 2
```sh
import java.util.LinkedHashMap;
import java.util.Map;
class LRUCache<K, V> {
private final int maxSize;
private final Map<K, V> cache;
public LRUCache(final int maxSize) {
this.maxSize = maxSize;
this.cache = new LinkedHashMap<K, V>(maxSize * 4 / 3, 0.75f, true) {
@Override
protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
return size() > maxSize;
}
};
}
public synchronized V get(K key) {
return cache.get(key);
}
public synchronized void put(K key, V value) {
cache.put(key, value);
}
}
```
#Question 3
Create a function that takes in an array of loan amounts and calculates the total interest on the loans, considering that no interest is applied on loans up to 2000 and a 20% interest is applied on remaining amounts in the array.
#Question 3
Write a Java program to implement a Bloom filter using a bit array and multiple hash functions. The Bloom filter should have a fixed size and should be able to add and check for the presence of elements efficiently.
#Answer 3
import java.util.BitSet;
import java.util.HashMap;
import java.util.Map;
class BloomFilter {
private BitSet bitset;
private int size;
private Map<Integer, Integer> hashFunctions;
public BloomFilter(int size) {
this.size = size;
this.bitset = new BitSet(size);
this.hashFunctions = new HashMap<>();
hashFunctions.put(1, 7);
hashFunctions.put(2, 11);
hashFunctions.put(3, 13);
}
public void add(String value) {
for (Integer key : hashFunctions.keySet()) {
int index = Math.abs(value.hashCode() * key) % size;
bitset.set(index, true);
}
}
public boolean check(String value) {
for (
#Question 4
Write a Java program to implement a thread-safe Singleton class using the double-checked locking mechanism.
#Answer 4
```sh
class Singleton {
private static volatile Singleton instance;
private Singleton() { }
public static Singleton getInstance() {
if (instance == null) {
synchronized (Singleton.class) {
if (instance == null) {
instance = new Singleton();
}
}
}
return instance;
}
}
```
#Question 5
Write a Java program to implement a generic tree data structure using classes and interfaces. The tree should support basic operations such as adding and removing nodes, and traversing the tree in pre-order, in-order, and post-order.
#Solution 5
```sh
interface Tree<T> {
public void addNode(T value);
public void removeNode(T value);
public void preOrderTraversal();
public void inOrderTraversal();
public void postOrderTraversal();
}
class TreeNode<T> {
T value;
List<TreeNode<T>> children;
public TreeNode(T value) {
this.value = value;
children = new ArrayList<TreeNode<T>>();
}
}
class GenericTree<T> implements Tree<T> {
private TreeNode<T> root;
// implements addNode, removeNode, preOrderTraversal, inOrderTraversal, postOrderTraversal methods
}
```