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

SDE - 1

Morgan Stanley
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, OOPS, OS, DBMS
Tip
Tip

Tip 1 : Work on Competitive Programming skills. That is one thing most companies look out for during hiring. Solve at least 100 
questions from every topic.
Tip 2 : You should have at least 2 good projects on your resume. Only write the things that you are completely sure of.
Tip 3 : Work on CS fundamentals as well like -OOPS, OS, and DBMS. There will be MCQ questions from this in the coding round as well as in the 1:1 round

Application process
Where: Referral
Eligibility: No
Resume Tip
Resume tip

Tip 1 : Need at least 2 good projects on the resume. Write a short 2-3 lines summary of the project and the tech stack 
used.
Tip 2 : Resume should be 1 page only. Try to keep the Resume short with useful information only.
Tip 3 : Your Resume should clearly mention the skillset you have. Companies sometimes filter out Resume based on 
skillset only

Interview rounds

01
Round
Easy
Face to Face
Duration60 mins
Interview date7 Jul 2021
Coding problem2

1. LCA of Two Nodes In A BST

Moderate
15m average time
85% success
0/80
Asked in companies
ShareChatSamsungAmazon

You are given a binary search tree of integers with N nodes. You are also given references to two nodes 'P' and 'Q' from this BST.


Your task is to find the lowest common ancestor(LCA) of these two given nodes.


The lowest common ancestor for two nodes P and Q is defined as the lowest node that has both P and Q as descendants (where we allow a node to be a descendant of itself)


A binary search tree (BST) is a binary tree data structure which has the following properties.

• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.


For example:
'P' = 1, 'Q' = 3
tree = 2 1 4 -1 -1 3 -1 -1 -1,

The BST corresponding will be- 

Here, we can clearly see that LCA of node 1 and node 3 is 2.
Problem approach

It is a standard tree ques

Try solving now

2. OS questions

Write an advantage of dynamic allocation algorithms?
Write a difference between internal fragmentation and external fragmentation?
How to recover from a deadlock?

Problem approach

Tip 1: You have to focus on CS Fundamentals - OS, OOPS, DBMS, CN
Tip 2: Solve SQL Queries from HackerRank

02
Round
Easy
Face to Face
Duration65 mins
Interview date13 Jul 2021
Coding problem2

1. Maximum Height Difference

Easy
15m average time
85% success
0/40
Asked in companies
YatraMorgan Stanley

You are given the root node of a binary tree consisting of 'N' nodes. Your task is to return the maximum height difference of the tree.

The height of a Binary Tree is defined as the number of nodes present in the longest path from the root node to any leaf node of the tree. The height difference of a node is equal to the absolute difference of height of the left and right subtree.

For example:

Example

For the given tree,
The maximum height difference is 1. The height difference of node 1 is the absolute difference of the height of subtree with root node 2, and the height of subtree with root node 3, which is 1. Hence the answer is 1. 
Example:
Elements are in the level order form. The input consists of values of nodes separated by a single space in a single line. In case a node is null, we take -1 in its place.

For example, the input for the tree depicted in the below image would be :

Example

1
2 3
4 -1 5 6
-1 7 -1 -1 -1 -1
-1 -1

Explanation :
Level 1 :
The root node of the tree is 1

Level 2 :
Left child of 1 = 2
Right child of 1 = 3

Level 3 :
Left child of 2 = 4
Right child of 2 = null (-1)
Left child of 3 = 5
Right child of 3 = 6

Level 4 :
Left child of 4 = null (-1)
Right child of 4 = 7
Left child of 5 = null (-1)
Right child of 5 = null (-1)
Left child of 6 = null (-1)
Right child of 6 = null (-1)

Level 5 :
Left child of 7 = null (-1)
Right child of 7 = null (-1)

The first not-null node (of the previous level) is treated as the parent of the first two nodes of the current level. 

The second not-null node (of the previous level) is treated as the parent node for the next two nodes of the current level and so on.

The input ends when all nodes at the last level are null (-1).
Note :
The above format was just to provide clarity on how the input is formed for a given tree. 

The sequence will be put together in a single line separated by a single space. Hence, for the above-depicted tree, the input will be given as:

1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
Try solving now

2. DBMS Questions

Why we cannot use the WHERE clause with aggregate functions like HAVING?
Difference between primary key and unique key and why one should use unique key if it allows only one null ?

Problem approach

Tip 1: You have to focus on CS Fundamentals - OS, OOPS, DBMS, CN
Tip 2: Solve SQL Queries from HackerRank

03
Round
Easy
Face to Face
Duration70 mins
Interview date16 Jul 2021
Coding problem1

1. Design question

I was asked to design Library Management System

Problem approach

Tip 1: Practice HLD and LLD on some commonly asked designs
Tip 2: You should know about basics like Caching, CAP Theorem

Here's your problem of the day

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

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Morgan Stanley
0 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Morgan Stanley
1864 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 3 problems
Interviewed by Morgan Stanley
867 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Morgan Stanley
903 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes