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

SDE - 1

Morgan Stanley
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Operating Systems, C++
Tip
Tip

Tip 1 : Make a document where you can add answers to those questions which you think the interviewer can ask you about your resume.
Tip 2 : Practise data structures and algorithms questions properly.
Tip 3 : Have a deep understanding of all core subjects.

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

Tip 1 : Have a 1 page resume only.
Tip 2 : Focus more on work experiences and skills.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration60 minutes
Interview date13 Aug 2021
Coding problem2

It was conducted as an online round.The test duration was 60 minutes consisting of two coding questions.

1. Boundary Traversal of Binary Tree

Hard
20m average time
85% success
0/120
Asked in companies
Goldman SachsOYOExpedia Group

You are given a binary tree having 'n' nodes.


The boundary nodes of a binary tree include the nodes from the left and right boundaries and the leaf nodes, each node considered once.


Figure out the boundary nodes of this binary tree in an Anti-Clockwise direction starting from the root node.


Example :
Input: Consider the binary tree A as shown in the figure:

alt text

Output: [10, 5, 3, 7, 18, 25, 20]

Explanation: As shown in the figure

The nodes on the left boundary are [10, 5, 3]

The nodes on the right boundary are [10, 20, 25]

The leaf nodes are [3, 7, 18, 25].

Please note that nodes 3 and 25 appear in two places but are considered once.
Problem approach

1. Print the left boundary in a top-down manner.
2. Print all leaf nodes from left to right, which can again be sub-divided into two sub-parts:
Print all leaf nodes of left sub-tree from left to right.
Print all leaf nodes of right subtree from left to right.
3. Print the right boundary in bottom-up manner.

Try solving now

2. Count Inversions

Moderate
40m average time
55% success
0/80
Asked in companies
Hewlett Packard EnterpriseBNY MellonGrab

For a given integer array/list 'ARR' of size 'N' containing all distinct values, find the total number of 'Inversions' that may exist.

An inversion is defined for a pair of integers in the array/list when the following two conditions are met.

A pair ('ARR[i]', 'ARR[j]') is said to be an inversion when:

1. 'ARR[i] > 'ARR[j]' 
2. 'i' < 'j'

Where 'i' and 'j' denote the indices ranging from [0, 'N').
Problem approach

Traverse through the array, and for every index, find the number of smaller elements on its right side of the array. This can be done using a nested loop. Sum up the counts for all index in the array and print the sum.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date16 Aug 2021
Coding problem2

Usually, companies asked questions mainly based on OOPS, DBMS, Low-Level Design using OOP, and Database Design using SQL Queries. But be prepared with all the CS Subjects because you never know what the interviewer will ask you during the interview.

1. Operating System Based Questions

What is the difference between process and threading?

Problem approach

Tip 1:  For Operating System, I have used Love Babbar CheatSheet, InterviewBit, and Gate Smashers OS Playlist. You can also refer Sanchit Jain Playlist
Tip 2 : Try to answer exactly and with some example

2. Merge Overlapping Intervals

Easy
10m average time
90% success
0/40
Asked in companies
GrowwGoldman SachsDirecti

Given 'N' number of intervals, where each interval contains two integers denoting the boundaries of the interval. The task is to merge all the overlapping intervals and return the list of merged intervals sorted in ascending order.

Two intervals will be considered to be overlapping if the starting integer of one interval is less than or equal to the finishing integer of another interval, and greater than or equal to the starting integer of that interval.

Example:
for the given 5 intervals - [1,4], [3,5], [6,8], [10,12], [8,9].
Since intervals [1,4] and [3,5] overlap with each other, we will merge them into a single interval as [1,5].

Similarly [6,8] and [8,9] overlaps, we merge them into [6,9].

Interval [10,12] does not overlap with any interval.

Final List after merging overlapping intervals: [1,5], [6,9], [10,12]
Problem approach

vector merge(vector& ins) {
if (ins.empty()) return vector{};
vector res;
sort(ins.begin(), ins.end(), [](Interval a, Interval b){return a.start < b.start;});
res.push_back(ins[0]);
for (int i = 1; i < ins.size(); i++) {
if (res.back().end < ins[i].start) res.push_back(ins[i]);
else
res.back().end = max(res.back().end, ins[i].end);
}
return res;
}

Try solving now

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
3 rounds | 5 problems
Interviewed by Morgan Stanley
0 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Morgan Stanley
0 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
904 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