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

SDE - 1

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

Interview preparation journey

expand-icon
Journey
This was a college placement drive arranged.I attended it and gave my best. I only got into the first round. I must have practiced more. This was a good opportunity to understand where i stood.
Application story
This was a placement drive to which I applied. This drive was for my 7th sem intern. we were prepared by college by it.
Why selected/rejected for the role?
I was not selected for this role , maybe should have tried harder. I only went till 1st round didn't go further.
Preparation
Duration: 3 months
Topics: Data structures, Algorithm, OOPS, Pointers, Algorithms
Tip
Tip

Tip 1 : Practice competitive programming regularly
Tip 2 : Look at interview experience
Tip 3 : Talk to seniors who work there

Application process
Where: Campus
Resume Tip
Resume tip

Tip 1 : Get it reviewed by professional
Tip 2 : Mention only what you know

Interview rounds

01
Round
Easy
Online Coding Interview
Duration90 minutes
Interview date17 Jun 2021
Coding problem3

1. Find Slope

Easy
22m average time
88% success
0/40
Asked in companies
Morgan StanleyHSBCJungleworks

Given a linked list, whose nodes represent the coordinates of the cartesian plane. Find the minimum and the maximum slope of simultaneous points of coordinates.

Linked List : P1(X1, Y1) -> P2( X2, Y2) -> P3(X3, Y3).

Here P1(point1) corresponds to coordinates (X1, Y1), similarly P2(point2) corresponds to coordinates (X2, Y2).

Your task is to find the Maximum(Slope(P1, P2), Slope(P2, P3)) and Minimum(Slope(P1, P2), Slope(P2, P3)).

Note :
You only need to return the starting node for minimum and maximum slope. So if slope(P1, P2) is maximum, just return P1.

In case of more than one possible solution return the first occurring solution.
Problem approach

# Python program for slope of line
def slope(x1, y1, x2, y2):
if(x2 - x1 != 0):
return (float)(y2-y1)/(x2-x1)
return sys.maxint


# driver code
x1 = 4
y1 = 2
x2 = 2
y2 = 5
print "Slope is:", slope(x1, y1, x2, y2)

Try solving now

2. Largest subarray with equal number of 0s and 1s

Moderate
10m average time
85% success
0/80
Asked in companies
OraclePhonePeSAP Labs

You are given an array consisting of 0s and 1s. You need to find the length of the largest subarray with an equal number of 0s and 1s.

For example:

If the given array is: [0, 0, 1, 0, 1] The largest subarray would be: [0, 1, 0, 1] (last 4 elements) having length 4.
Problem approach

The brute force approach in these type of questions is to generate all the possible sub-arrays. Then firstly check whether the sub-array has equal number of 0’s and 1’s or not. To make this process easy take cumulative sum of the sub-arrays taking 0’s as -1 and 1’s as it is. The point where cumulative sum = 0 will signify that the sub-array from starting till that point has equal number of 0’s and 1’s. Now as this is a valid sub-array, compare it’s size with the maximum size of such sub-array found till now.

Try solving now

3. Longest Substring Without Repeating Characters

Moderate
30m average time
65% success
0/80
Asked in companies
AdobeInformaticaIntuit

Given a string input of length n, find the length of the longest substring without repeating characters i.e return a substring that does not have any repeating characters.

Substring is the continuous sub-part of the string formed by removing zero or more characters from both ends.

Problem approach

We can consider all substrings one by one and check for each substring whether it contains all unique characters or not. There will be n*(n+1)/2 substrings. Whether a substring contains all unique characters or not can be checked in linear time by scanning it from left to right and keeping a map of visited characters. 

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
4 rounds | 8 problems
Interviewed by Morgan Stanley
1864 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