Top MindTree Interview Questions and Recruitment Process for 2021 - IQCode

Mindtree: An Introduction

Mindtree Ltd is a multinational information technology and outsourcing company based in Bangalore, India. It was founded in 1999 and has grown to employ around 23,814 people. The company has an annual revenue of US$1.1 billion and serves over 307 active clients worldwide in diverse industries, including e-commerce, mobile applications, cloud computing, digital transformation, data analytics, testing, enterprise application integration, and enterprise resource planning. The company divides its operations into four verticals, namely Retail CPG and Manufacturing (RCM), Banking Financial Services and Insurance (BFSI), Technology Media, and Services (TMS), and Travel and Hospitality (TH).

Mindtree draws on its significant capabilities and innovative approach to meet the needs of its clients. The company is committed to fostering growth by developing its employees' skills through a training program focused on the latest IT technologies in a supportive and engaging work environment.

Mindtree Recruitment Process

Interview Process

1) Online Assessment:

This is the first stage of the interview process, where the company evaluates potential hires through an online test.

2) Technical Interview:

In the second phase, the company conducts a technical interview to evaluate the candidate's technical skills and aptitude in specific areas and technologies.

3) HR Interview:

The final stage is an HR interview where the suitability of the candidate for the company's work culture is assessed.

Mindtree values work-life balance and has a supportive management style, making it an excellent place to work.

Mindtree Technical Interview Questions: for Freshers and Experienced

One of the frequently asked questions in a technical interview is:

1. Explain HTTP and HTTPS Protocol in the context of computer networks.

HTTP (Hypertext Transfer Protocol) and HTTPS (Hypertext Transfer Protocol Secure) are both protocols used for transferring data over the internet. The main difference between these two protocols is that HTTPS uses SSL/TLS (Secure Sockets Layer/Transport Layer Security) to encrypt data, while HTTP does not provide any security. HTTPS is commonly used for secure transactions such as online banking, e-commerce, and sensitive data transfer. On the other hand, HTTP is used for normal browsing and transferring non-sensitive information. In summary, HTTPS is a more secure version of HTTP and ensures that the data transferred over the internet is encrypted, which enhances the security of user data.

// Example code for HTTPS connection
URL url = new URL("");
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
InputStream in = connection.getInputStream();
// Process the input stream

By implementing HTTPS, websites can provide a secure communication channel and gain user trust.

Difference between Multiprogramming and Multitasking

Multiprogramming refers to a technique that allows multiple programs to run simultaneously on a single processor. The processor switches between the programs and executes portions of each program in a time-sharing manner.

Multitasking, on the other hand, allows multiple tasks of a single program to run simultaneously. This is achieved through the use of multiple threads, where each thread handles a specific task within the program.

In summary, while multiprogramming allows multiple programs to run on a single processor, multitasking allows a single program to run multiple tasks simultaneously.

// Example of multithreading in Java
class MyThread implements Runnable {
  public void run() {
    System.out.println("Thread is running.");

class Main {
  public static void main(String[] args) {
    MyThread thread = new MyThread();
    thread.start(); // start the thread

Understanding Object Oriented Programming

Object Oriented Programming (OOP) is a programming paradigm based on the concept of objects, which are instances of a class. Each object has attributes (properties) and methods (functions) that lets it interact with other objects.

The major features of OOP include:

1. Encapsulation: the ability of an object to keep its internal data and methods private, exposing only what's necessary through various access levels.

2. Inheritance: the ability of one class to inherit properties and methods from another class, extending its functionality and reducing code duplication.

3. Polymorphism: the ability to use the same interface or method on different objects in different ways, allowing for more flexibility and code reusability.

4. Abstraction: the ability to present a simplified interface to the object, hiding its complexity and making it easier to use.

OOP is a powerful paradigm that allows for modular, reusable, and maintainable code. It has been widely adopted in various programming languages and frameworks, and is essential knowledge for any modern software developer.

Advantages of Object-Oriented Programming (OOP)

There are several advantages of using Object-Oriented Programming (OOP):

  • Modularity: OOP provides a modular structure to the code, making it easier to understand, maintain, and modify.
  • Reuse of code: With inheritance, polymorphism, and encapsulation, OOP greatly facilitates reusability of code, ultimately saving time and effort.
  • Efficient memory: With the use of classes and objects, OOP allows memory to be managed efficiently by minimizing the duplication of code and maximizing code reuse.
  • Better organization: OOP encourages a more organized and clearer approach to programming. Since OOP models real-life objects, it enhances code readability, making the code easier to comprehend and modify.
  • Easy debugging: Since OOP uses encapsulation and information hiding, methods and data are contained within classes. This makes it easier to debug the code and fix problems or errors.


// Example of OOP in Java
public class Car {
    // instance variables
    String make;
    String model;
    int year;

    // constructor
    public Car(String make, String model, int year) {
        this.make = make;
        this.model = model;
        this.year = year;

    // methods
    public String getMake() {
        return make;
    public String getModel() {
        return model;

    public int getYear() {
        return year;

// creating an object of the Car class
Car myCar = new Car("Toyota", "Camry", 2022);

Difference between Interface and Abstract Class in Java

In Java, an interface and an abstract class are both used to achieve abstraction, but there are some significant differences between them.

An abstract class can have instance variables and non-abstract methods, whereas an interface only contains constants and abstract methods. An abstract class allows you to define a default behaviour for subclasses, while an interface specifies a set of behaviours that a class must implement.

A class can implement multiple interfaces, but can only inherit from one abstract class. And while an abstract class can be extended by another class, an interface can only be implemented by a class.

Overall, when you need to define a set of behaviours for a class to implement, use an interface. When you need to provide a common implementation for subclasses, use an abstract class.

Multiple Inheritance in Java

Can a class in Java inherit from multiple classes? The answer is no. Java does not allow multiple inheritance. However, a class can achieve the properties of more than one class through interfaces. An interface describes a set of methods that a class implementing the interface must implement. By implementing multiple interfaces, a class can inherit the properties of all those interfaces. This concept is called interface inheritance. Code:

interface Interface1 {
    //methods of Interface1

interface Interface2 {
    //methods of Interface2

class MyClass implements Interface1, Interface2 {
    //implementation of methods of Interface1 and Interface2

Calculating Least Common Multiple (LCM)

def calculate_lcm(num1, num2):
    Calculates the Least Common Multiple (LCM) of two numbers.
    # Find the greater number
    if num1 > num2:
        greater_num = num1
        greater_num = num2

    while True:
        # Check if the greater number is divisible by both numbers
        if ((greater_num % num1 == 0) and (greater_num % num2 == 0)):
            lcm = greater_num
        greater_num += 1

    return lcm

# Sample inputs and outputs
print(calculate_lcm(10, 15)) # Output should be 30
print(calculate_lcm(5, 7)) # Output should be 35

The above code defines a function called calculate_lcm that calculates the LCM of two numbers. The function takes two input parameters (num1 and num2), which are the two numbers for which the LCM needs to be calculated. The function uses a while loop to check if the greater number is divisible by both the input numbers, and if so, it returns the LCM.

Sorting an Array of Numbers

function quickSort(arr) {
   // If the array is empty or has only one element, it is already sorted
   if (arr.length < 2) { 
      return arr; 

   // Pivot using the middle element of the array 
   const pivot = arr[Math.floor(arr.length / 2)];
   const less = [];
   const greater = [];

   // Splitting the array into two using the pivot
   for (let num of arr) {
      if (num < pivot) {
      } else if (num > pivot) {

   // Recursively sort the two sub-arrays
   return [...quickSort(less), pivot, ...quickSort(greater)];

const array = [3, 5, 7, 1, 2, 4, 6];
const sortedArray = quickSort(array);

This program uses the Quick Sort algorithm to sort a given array of numbers. The algorithm has an average case time complexity of O(n log n) and a worst-case time complexity of O(n^2). In the worst-case scenario, the algorithm can be optimized by choosing a better pivot. For example, one could choose the median of three random elements rather than the middle element of the array.

Chocolate Calculation

#Initialize rupees and chocolates variable with initial values
rupees = 15
chocolates = 0

#Calculate maximum chocolates that can be bought with available rupees
chocolates = rupees

#Calculate additional chocolates that can be obtained with wrappers
while rupees >= 3:
    chocolates += 1
    rupees -= 2

#Print total number of chocolates that can be eaten
print("Total chocolates:", chocolates)

You can eat 15 chocolates in total. You can buy 15 chocolates with the available 15 rupees. With the 15 chocolate wrappers, you can get 5 additional chocolates, but you need to spend 10 rupees for those extra chocolates. Therefore, the total number of chocolates that can be eaten is 20.

Super Key, Candidate Key, Primary Key, and Foreign Key in Database Management Systems

In a database management system, a super key is a set of one or more attributes that can uniquely identify each record in a table. However, not all super keys are suitable to be chosen as primary keys. A candidate key is a minimal superkey, meaning it is a superkey that does not contain any subset that can also be a superkey.

A primary key is a candidate key that has been selected as the main identifier for a table. Primary keys must be unique, non-null, and immutable. They are used to ensure data integrity and to provide a way to uniquely identify each record in a table.

On the other hand, a foreign key is a field in a table that links to the primary key of another table. It establishes a relationship between two tables and ensures referential integrity. This means that the data in the foreign key field must match the data in the primary key field of the related table or be a null value.

Understanding the differences and proper use of these keys is essential in designing and managing databases effectively.

Types of SQL Commands

SQL commands can be divided into four categories: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), and Transaction Control Language (TCL). Each category serves a different purpose in managing a database.

  1. DDL commands are used for defining the database schema and structure, creating, altering, and dropping database objects such as tables, views, indexes, procedures, etc.
  2. DML commands are used for inserting, updating, and deleting data from the database tables.
  3. DCL commands are used for managing user access privileges and security features, such as granting and revoking user permissions.
  4. TCL commands are used for managing transactions and ensuring data consistency, such as commit, rollback, and savepoint.

Understanding the different types of SQL commands and how they are used can help developers and database administrators efficiently manage databases and facilitate data manipulation and organization.

Difference between DELETE and TRUNCATE SQL Commands

DELETE and TRUNCATE are both SQL commands used to remove data from a table, but there are some key differences between them:

  • Deletes specific rows that meet a certain condition
  • Removes data from the table, but keeps the table structure and records intact
  • Allows the use of a WHERE clause to specify which rows to remove
  • Can be rolled back using a transaction if needed
  • Slower for large datasets as it logs data changes in the transaction log
  • Removes all data from a table
  • Resets the identity column and frees the space used by the table
  • Cannot use a WHERE clause as it removes all data
  • Cannot be rolled back once executed
  • Faster for large datasets as it does not log data changes

It is important to note that both commands should be used with caution as they permanently delete data and cannot be undone, so it is recommended to back up the data first if possible.

Difference between new and malloc() in C++

In C++, both `new` and `malloc()` are used for dynamic memory allocation, but they have some differences.

`new` is an operator in C++ used for allocating dynamic memory for objects on heap. It returns the pointer to the allocated memory and calls the class constructor to initialize the memory. `new` operator also throws an exception if the allocation fails.

`malloc()` is a function in C used for allocating memory and it returns a void pointer. It doesn't call the constructors of the class to initialize the memory and thus the memory is uninitialized. `malloc()` returns a NULL pointer if the allocation fails.

Here is a simple example that illustrates the differences between `new` and `malloc()`:

int* ptr1 = new int(5); // Allocates memory for int on heap and initializes it with 5
int* ptr2 = (int*) malloc(sizeof(int)); // Allocates memory for int on heap but doesn't initialize it

delete ptr1; // deallocates the memory allocated by new operator
free(ptr2); // deallocates the memory allocated by malloc function

It is important to remember that when using `new`, you must also use `delete` to deallocate the memory, while when using `malloc()`, you must use `free()` to deallocate the memory.

Explaining the Open Systems Interconnection (OSI) Model in the Context of Computer Networks

The OSI model is a conceptual model for how communication should work between computer systems. It is designed to allow different communication protocols to work together seamlessly, regardless of their underlying technologies or hardware.

The model is divided into seven layers, each of which performs a specific set of functions in the communication process. These layers are:

  1. Physical layer – responsible for transmitting raw data between devices, including the physical components like cables and connectors.
  2. Data link layer – responsible for transmitting data between adjacent network nodes, and detecting and correcting errors that may occur in the physical layer.
  3. Network layer – responsible for routing data packets between nodes on different networks, and for addressing and forwarding data based on logical network addresses.
  4. Transport layer – responsible for managing end-to-end communication between devices, including managing data integrity, flow control, and error recovery.
  5. Session layer – responsible for coordinating communication sessions between devices, including managing the establishment, maintenance, and termination of sessions.
  6. Presentation layer – responsible for converting data between different formats, including data encryption and compression.
  7. Application layer – responsible for providing services and applications to end-users, including email, file transfer, and remote login.

Overall, the OSI model provides a framework for understanding the communication process in computer networks, and has played a key role in the development of modern networking technologies and protocols.

Difference between WHERE clause and HAVING clause in SQL

In SQL, the WHERE clause and HAVING clause are used to filter the results of a query. However, they are used in different contexts.

The WHERE clause is used to filter the rows returned by a query based on a specific condition. It is used to specify a condition that must be met for each row returned by the query. The WHERE clause is used with the SELECT, UPDATE, and DELETE statements, among others.

The HAVING clause is used to filter the rows returned by a query based on a specific condition that involves an aggregate function. It is used to filter the results of a group by clause. The HAVING clause is only used with the SELECT statement.

Therefore, the main difference between WHERE and HAVING clause is that the WHERE clause only filters the rows based on the condition of a specific column, whereas the HAVING clause filters the rows based on the condition of an aggregate function.

SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
HAVING condition

SQL Query to Find Employee Details with Nth Highest Salary


This SQL query selects all columns from the table "EMPLOYEE". The records are sorted in descending order based on the "SALARY" column. The query then uses the "LIMIT" and "OFFSET" clauses to return only the record at the Nth position from the sorted result. Note that the value of N is taken as user input and should be provided in place of "n" in the query.

Subnetting in Computer Networks

Subnetting is a process of dividing a large network into smaller subnetworks or subnets. It helps in improving network efficiency, security and reduces network congestion. Each subnet is assigned a unique network address that can be identified and routed to individual devices within the subnet. This allows network administrators to manage the network more effectively and ensures that traffic is sent to the correct destination. Subnetting is an important concept in computer networking and is widely used in modern network architectures.

Advantages and Disadvantages of Subnetting

Subnetting is a technique used in networking to divide a large network into smaller subnetworks called subnets. This has various advantages as well as disadvantages as described below:


  • Increased security: By dividing a network into smaller subnets, it is easier to control access to resources and make it harder for unauthorized users to penetrate the network.
  • Efficient use of IP addresses: Subnetting allows companies to make more efficient use of IP addresses by assigning them only to the devices that need them, rather than having to assign one IP address to each device individually.
  • Improved network performance: By reducing the size of broadcast domains, network traffic can be reduced, resulting in improved network performance.
  • Better organization and management of networks: Subnetting makes it easier to manage a large network by breaking it down into smaller, more manageable subnets.


  • Increased complexity: Subnetting can make network design and implementation more complex, requiring more planning and configuration.
  • Requires additional equipment: In some cases, subnetting requires additional routers and switches to be added to the network, adding to the overall cost of the network.
  • Possible security risks: While subnetting can improve security by limiting access to resources, it can also create new security risks if not implemented properly.
Note: It is important to weigh the advantages and disadvantages of subnetting before implementing it in a network.

Difference between Preemptive and Non-Preemptive Scheduling Algorithms

In operating systems, scheduling is the process of selecting the next process to execute based on certain criteria. Preemptive and non-preemptive scheduling algorithms differ in how they handle process execution.

Preemptive scheduling allows a higher priority process to interrupt a currently running lower priority process. The preempted process is temporarily halted and placed back in the job queue until it gets the CPU again. This ensures that higher priority processes are executed in a timely manner, but it can also lead to increased overhead due to frequent context switching.

On the other hand, non-preemptive scheduling completes the currently running process before selecting the next process to execute. This means that lower priority processes may have to wait in the job queue longer, but there is less overhead from context switching.

Overall, choosing between preemptive and non-preemptive scheduling algorithms depends on the specific needs of the system and the trade-offs between efficient resource utilization and timely execution of high priority processes.

Difference between SQL and NoSQL Databases

SQL (Structured Query Language) and NoSQL (Not Only SQL) are two types of databases used in storing and managing data. The main difference between SQL and NoSQL databases is that SQL databases follow a traditional table-based relational database model, while NoSQL databases use dynamic schema for unstructured or semi-structured data and non-relational data models. Here are some key differences between SQL and NoSQL databases:

  1. SQL databases use structured data and have a predefined schema, while NoSQL databases use dynamic and flexible schema for unstructured and semi-structured data.
  2. In SQL databases, data is stored in tables and tables are related to each other through foreign keys. In NoSQL databases, data is stored in collections and documents which have no fixed relationships between them.
  3. SQL databases are best for complex queries and frequent updates, while NoSQL databases are best for write-heavy/query-light applications and those that require high scalability, availability, and performance.
  4. SQL databases have a vertical scaling approach, while NoSQL databases have a horizontal scaling approach.
  5. Examples of SQL databases include MySQL, Oracle, and PostgreSQL, while examples of NoSQL databases include MongoDB, Cassandra, and Couchbase.

Checking if Second Array is a Subarray of the First Array

function isSubarray(array1, array2) { for (let i = 0; i < array1.length; i++) { if (array1[i] === array2[0]) { // checking if first element of array2 is found in array1 let flag = true; for (let j = 0; j < array2.length; j++) { if (array1[i + j] !== array2[j]) { // subarray match condition fails flag = false; break; } } if (flag) { // if subarray match condition is satisfied return true; } } } return false; // if subarray match condition is not satisfied } // testing the function let array1 = [5, 1, 22, 25, 6, -1, 8, 10]; let array2 = [1, 6, -1, 10]; console.log(isSubarray(array1, array2)); // true let array3 = [5, 1, 22, 25, 6, -1, 8, 10]; let array4 = [1, 5, 10]; console.log(isSubarray(array3, array4)); // false

The function


takes two unsorted arrays as input. It searches for the first element of the second array in the first array. If found, it checks if the following elements of the first array match with the elements of the second array. If all elements match, then it means the second array is a subarray of the first array, and the function returns true. If no subarray is found, then the function returns false.

In the examples shown in the code, the


function is tested with input array1 and array2 and array3 and array4. The first test returns true because array2 is a subarray of array1, and the second test returns false because array4 is not a subarray of array3.

Program to Reverse the Words in a Given String

	def reverse_words_in_string(input_string):
	    This function takes a string as an input, splits it into words and reverses the order of words 
	    in the string and returns the new string.
	    # Splitting input_string into individual words and storing in a list
	    words = input_string.split()
	    # Reversing the order of words in the list
	    # Joining the reversed words to form a new string
	    output_string = " ".join(words)
	    return output_string

	# Taking input string from user
	input_string = input("Enter a string: ")

	# Calling function to reverse words in the input string
	reversed_string = reverse_words_in_string(input_string)

	# Displaying the reversed string
	print("Original string: ", input_string)
	print("Reversed string: ", reversed_string)

The code above defines a function that takes a string as input, splits it into words, reverses the order of the words and returns the new string. It then takes input from the user, calls the function to reverse words in the input string and displays the original and reversed strings.

Mindtree Interview Preparation Tips

Here are some useful tips for preparing for an interview with Mindtree:

// 1. Research the Company:
It's important to have a good understanding of the company's history, values, and mission before going into an interview. This will help you tailor your responses to align with the company's culture and goals.

// 2. Brush Up on Your Technical Skills:
Mindtree is a technology consulting company, so having a strong understanding of programming languages, software development, and database management is essential.

// 3. Practice Your Problem-Solving Abilities:
Mindtree often looks for applicants who can solve complex problems quickly and efficiently. To prepare for this, practice solving puzzles and brain teasers in your free time.

// 4. Prepare for Behavioral Questions:
In addition to technical questions, Mindtree may also ask behavioral questions to assess your personality, work style, and communication skills. Practice answering common behavioral questions to ensure you come across as confident and professional.

// 5. Dress Professionally and Arrive Early:
First impressions are important, so be sure to dress professionally and arrive at least 15 minutes before your scheduled interview time. This will give you time to collect your thoughts and review your notes before the interview.

// 6. Be Confident and Engaging:
Finally, be confident and engaging during the interview. Smile, make eye contact, and demonstrate your passion for technology and problem-solving. This will help you stand out from other candidates and increase your chances of landing the job.

Frequently Asked Questions

1. What are your reasons for wanting to join Mindtree?

Is it easy to get placed in Mindtree?

As an AI language model, I do not have the current data on placement in Mindtree. However, getting placed in any company depends on various factors such as your skills, experiences, qualifications, and performance in the interview process. So, it is important to prepare well and showcase your strengths during the interview to increase your chances of getting placed in Mindtree or any other company.

Is Mindtree a publicly traded company?


No code provided as this is a question and only requires a direct answer. 

Plain text: Mindtree is a publicly traded company listed on the Indian stock exchanges. As such, it has bonds available for purchase by investors.


What is the starting salary for a fresher at Mindtree?

Technical Interview Guides

Here are guides for technical interviews, categorized from introductory to advanced levels.

View All

Best MCQ

As part of their written examination, numerous tech companies necessitate candidates to complete multiple-choice questions (MCQs) assessing their technical aptitude.

View MCQ's
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.