Mindtree interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Mindtree
upvote
share-icon
3 rounds | 11 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 Months
Topics: Data Structures, Algorithms, System Design, Aptitude, DBMS, OS, OOPS
Tip
Tip

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Interview rounds

01
Round
Medium
Online Coding Test
Duration120 Minutes
Interview date4 Dec 2020
Coding problem3

This round had 3 coding questions of Easy, Medium and High level. Apart from the coding questions, this round also had some MCQ's related to Aptitude and Vocabulary. Both the sections had to be solved under 1 hour each.

1. Sum Of Squares Of First N Natural Numbers

Easy
15m average time
85% success
0/40
Asked in companies
SamsungPaytm (One97 Communications Limited)Sprinklr

You are given an integer 'N'. You need to find the sum of squares of the first 'N' natural numbers.

For example:
If 'N' = 4. You need to return 1^2 + 2^2 + 3^2 + 4^2 = 30.
Problem approach

Approach 1(Brute Force) : 
1) Run a for loop from 1 to ‘N’.
2) Sum up the squares of each number from 1 to ‘N’.
3) Finally, return this sum.

TC : O(N), where N is the given number
SC : O(1)


Approach 2 (Using Mathemical Formula) :
The sum of squares of first N natural numbers is given by: 1^2 + 2^2 + … N^2 = N*(N+1)*(2*N+1)/6

TC : O(1)
SC : O(1)

Try solving now

2. Find prime numbers

Easy
15m average time
80% success
0/40
Asked in companies
AdobeSalesforceDeutsche Bank

You are given a positive integer ‘N’. Your task is to print all prime numbers less than or equal to N.

Note: A prime number is a natural number that is divisible only by 1 and itself. Example - 2, 3, 17, etc.

You can assume that the value of N will always be greater than 1. So, the answer will always exist.

Problem approach

Approach (Using Sieve of Eratosthenes) :

1) First, we will make a boolean array/list isPrime of size N + 1. This will mark if a number is prime or not. Initially, all values will be true.

2) Then, we initialize a variable num equal to 2 which represents the current processing prime number.

3) We will loop as num from 2 to N^½:
3.1) If num is not prime, we continue.
3.2) Else, we will mark all multiples of num in isPrime as false.

4) In the end, we will iterate through isPrime and store all primes in the result vector/list.

5) Finally, we return the result vector.

TC : O(N * log(log N)), where N is the given positive integer.
SC : O(N)

Try solving now

3. Boundary Traversal

Easy
0/40
Asked in companies
DeloitteMindtree

You have been given a binary tree of integers. Your task is to print the boundary nodes of this binary tree in an Anti-Clockwise direction starting from the root node.

NOTE: The boundary nodes of a binary tree include nodes from the left boundary, right boundary and the leaf nodes without duplicate nodes. However, the values from the nodes may contain duplicates.

For Example:

alt text

Problem approach

Approach : 

The boundary traversal of a binary tree can be broken down into 4 parts. These parts are given in the same order as they are present in the traversal-

1) The root node - The root node will always be our first node in the whole boundary traversal.

2) The left boundary - Process them next except for the leaf node as it will be processed in our next part. We can use recursion for this and traverse for only left child until a leaf node is encountered. If the left child is not present we recurse for the right child.

3) The leaf Nodes - The leaf nodes of the binary tree will be processed next. We can use a simple inorder traversal for that. Inorder traversal will make sure that we process leaf nodes from left to right.

4) The right boundary - The right most nodes of the right subtree will be processed at last in reverse order except for the leaf node as it is already processed in the previous part. For this, we can use recursion in a postorder manner and traverse for the right child only until we encounter a leaf node. If the right child is not present we will recurse for the left child. 

TC : O(N), where N=total number of nodes in the binary tree
SC : O(N)

Try solving now
02
Round
Easy
Video Call
Duration60 Minutes
Interview date5 Dec 2020
Coding problem7

This round had 1 simple coding question related to Tree Traversal followed by questions from OOPS and DBMS. At the end, I was also asked to execute a simple SQL query.

1. Tree Traversals

Easy
15m average time
85% success
0/40
Asked in companies
Wells FargoCognizantBig Basket

You have been given a Binary Tree of 'N'

nodes, where the nodes have integer values.


Your task is to return the ln-Order, Pre-Order, and Post-Order traversals of the given binary tree.


For example :
For the given binary tree:

Binary - Tree1

The Inorder traversal will be [5, 3, 2, 1, 7, 4, 6].
The Preorder traversal will be [1, 3, 5, 2, 4, 7, 6].
The Postorder traversal will be [5, 2, 3, 7, 6, 4, 1].
Problem approach

Inorder Traversal : 

void inorder(TreeNode*root)
{
if(root)
{
inorder(root->left);
cout inorder(root->right);
}
}

Preorder Traversal : 

void preorder(TreeNode*root)
{
if(root)
{
preorder(root->left);
preorder(root->right);
cout }
}

Try solving now

2. OS Question

Explain deadlock. How would you handle a deadlock?

Problem approach

Deadlock : Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process.
Consider an example when two trains are coming toward each other on the same track and there is only one track, none of the trains can move once they are in front of each other. A similar situation occurs in operating systems when there are two or more processes that hold some resources and wait for resources held by other(s).

Deadlock can arise if the following four conditions hold simultaneously (Necessary Conditions) :
1) Mutual Exclusion : One or more than one resource are non-shareable (Only one process can use at a time)
2) Hold and Wait : A process is holding at least one resource and waiting for resources.
3) No Preemption : A resource cannot be taken from a process unless the process releases the resource.
4) Circular Wait : A set of processes are waiting for each other in circular form.



Methods for handling deadlock :
There are three ways to handle deadlock
1) Deadlock prevention or avoidance : The idea is to not let the system into a deadlock state.
One can zoom into each category individually, Prevention is done by negating one of above mentioned necessary conditions for deadlock.
Avoidance is kind of futuristic in nature. By using strategy of “Avoidance”, we have to make an assumption. We need to ensure that all information about resources which process will need are known to us prior to execution of the process. We use Banker’s algorithm in order to avoid deadlock.
2) Deadlock detection and recovery : Let deadlock occur, then do preemption to handle it once occurred.
3) Ignore the problem altogether : If deadlock is very rare, then let it happen and reboot the system. This is the approach that both Windows and UNIX take.

3. OOPS Question

What is meant by Inheritance?

Problem approach

The term “inheritance” means “receiving some quality or behavior from a parent to an offspring.” In object-oriented programming, inheritance is the mechanism by which an object or class (referred to as a child) is created using the definition of another object or class (referred to as a parent). Inheritance not only helps to keep the implementation simpler but also helps to facilitate code reuse. 

The various types of inheritance include:

1) Single inheritance
2) Multiple inheritances
3) Multi-level inheritance
4) Hierarchical inheritance
5) Hybrid inheritance

4. OOPS Question

What is Abstraction?

Problem approach

If you are a user, and you have a problem statement, you don't want to know how the components of the software work, or how it's made. You only want to know how the software solves your problem. Abstraction is the method of hiding unnecessary details from the necessary ones. It is one of the main features of OOPs. 
For example, consider a car. You only need to know how to run a car, and not how the wires are connected inside it. This is obtained using Abstraction.

5. OOPS Question

How does C++ support Polymorphism?

Problem approach

C++ is an Object-oriented programming language and it supports Polymorphism as well:

Compile Time Polymorphism : C++ supports compile-time polymorphism with the help of features like templates, function overloading, and default arguments.

Runtime Polymorphism : C++ supports Runtime polymorphism with the help of features like virtual functions. Virtual functions take the shape of the functions based on the type of object in reference and are resolved at runtime.

6. DBMS Question

Explain different types of Normalization forms in a DBMS.

Problem approach

Normalization is the process of minimizing redundancy from a relation or set of relations. Redundancy in relation may cause insertion, deletion, and update anomalies. So, it helps to minimize the redundancy in relations. Normal forms are used to eliminate or reduce redundancy in database tables.

Types of Normal Form :
1) 1NF : It is known as the first normal form and is the simplest type of normalization that you can implement in a database. A table to be in its first normal form should satisfy the following conditions:
i) Every column must have a single value and should be atomic.
ii) Duplicate columns from the same table should be removed.
iii) Separate tables should be created for each group of related data and each row should be identified with a unique column.


2) 2NF : It is known as the second normal form. A table to be in its second normal form should satisfy the following conditions :
i )The table should be in its 1NF i.e. satisfy all the conditions of 1NF.
ii) Every non-prime attribute of the table should be fully functionally dependent on the primary key i.e. every non-key attribute should be dependent on the primary key in such a way that if any key element is deleted then even the non_key element will be saved in the database.


3) 3NF : It is known as the third normal form. A table to be in its second normal form should satisfy the following conditions :
i) The table should be in its 2NF i.e. satisfy all the conditions of 2NF.
ii) There is no transitive functional dependency of one attribute on any attribute in the same table.


4) BCNF : BCNF stands for Boyce-Codd Normal Form and is an advanced form of 3NF. It is also referred to as 3.5NF for the same reason. A table to be in its BCNF normal form should satisfy the following conditions :
i) The table should be in its 3NF i.e. satisfy all the conditions of 3NF.
ii) For every functional dependency of any attribute A on B
(A->B), A should be the super key of the table. It simply implies that A can’t be a non-prime attribute if B is a prime attribute.

7. SQL Question

Write a query that joins two tables A and B having common attribute ID and selects records(ID_NAME) that have matching ID values in both tables .

Problem approach

SELECT A.ID_Name, B.ID_Name
FROM A
INNER JOIN B ON A.ID=B.ID;

03
Round
Easy
HR Round
Duration30 Minutes
Interview date5 Dec 2020
Coding problem1

This is a cultural fitment testing round. HR was very frank and asked standard questions. Then we discussed about my role.

1. Basic HR Question

Why should we hire you ?

Problem approach

Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the work environment etc.
Tip 4 : Since everybody in the interview panel is from tech background, here too you can expect some technical questions. No coding in most of the cases but some discussions over the design can surely happen.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

To make an AI less repetitive in a long paragraph, you should increase:

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
4 rounds | 4 problems
Interviewed by Mindtree
839 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 7 problems
Interviewed by Mindtree
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 3 problems
Interviewed by Mindtree
1589 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 5 problems
Interviewed by Mindtree
0 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114453 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57719 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34914 views
7 comments
0 upvotes