Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Morgan Stanley interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

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

Interview preparation journey

expand-icon
Preparation
Duration: 4 Months
Topics: Data Structures, Algorithms, Operating Systems, Database Management Systems, Dynamic Programming, Graph Theory, Trees, Backtracking, Recursion
Tip
Tip

Tip 1 : For Morgan Stanley specifically, OS fundamentals are absolutely important, as they ask very deep OS based questions in interviews.
Tip 2 : For other core subjects, OOPS implementation is very crucial as they check DSA along with OOPS in all rounds. 
Tip 3 : For the OA, hard level questions of backtracking, trees (BSTs) and questions on two-pointer and sliding window algorithm are repeatedly asked. 
Tip 4 : Morgan Stanley has a very high CGPA cutoff for on campus placement (for example: 9.1+), so if you are aiming to crack Morgan Stanley you must pay attention to your CGPA as well.

Application process
Where: Campus
Eligibility: % in X and XII – 70% or 7.0 CGPA , in Pursuing Degree – 85% or 8.5 CGPA, No Standing Arrears
Resume Tip
Resume tip

Tip 1 : If possible, try to have at least one core subject project on your resume 
Tip 2 : Try to add coursework such as Operating Systems, Parallel and Distributed Computation, 
Tip 3 : If you have done any research work in any core subject it helps with resume shortlisting alot

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date20 Nov 2022
Coding problem3

The test was conducted on July 20th at 1pm, the duration was 90 minutes. We had to solve 3 questions, they were or medium hard level. The problems required printing the complete solutions and not just the count so DP based solutions could not work instead good level of implementation skills in backtracking and binary tree traversals helped were required.

1. Valid Parentheses

Easy
10m average time
80% success
0/40
Asked in companies
OracleSwiggyAmerican Express

You're given a string 'S' consisting of "{", "}", "(", ")", "[" and "]" .


Return true if the given string 'S' is balanced, else return false.


For example:
'S' = "{}()".

There is always an opening brace before a closing brace i.e. '{' before '}', '(' before ').
So the 'S' is Balanced.
Try solving now

2. Combination Sum

Hard
45m average time
55% success
0/120
Asked in companies
Morgan StanleySalesforceMyntra

You have been given three numbers ‘X’, ’Y’ and ‘Z’. You have to find the sum of all the numbers formed by the combination of the digits 3, 4 and 5. You can use 3 at most ‘X’ times, 4 at most ‘Y’ times, and 5 at most ‘Z’ times as a digit in numbers.

Note:
 Output the sum modulo 10 ^ 9 + 7.
For example :
If ‘X’ = 1, ‘Y’ = 1 and ‘Z’ = 0 then the output will be 84.

Explanation : 3 + 4 + 34 + 43 = 84
Try solving now

3. Unique Binary Search Trees

Moderate
20m average time
80% success
0/80
Asked in companies
eBayShareChatMorgan Stanley

You are given an integer ‘N’, your task is to return the number of structurally unique BST's (binary search trees) which have exactly 'N' nodes of unique values from 1 to 'N'.

For example:

Given  ‘N’ = 2, The total number of BST’s is 2.

Note:

1. A binary search tree is a rooted binary tree whose internal nodes each store a key greater than all the keys in the node's left subtree and less than those in its right subtree.

2. A structurally unique binary search tree is a tree that has at least 1 node at a different position or with a different value compared to another binary search tree.
Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date21 Nov 2022
Coding problem2

I passed this round. This was the first interview round, scheduled at 9 in the morning. It was a technical, elimination-based round. The topics covered in this round included DSA questions, Zigzag traversal of tree (Using deque was preferred by the interviewer) and a problem based on the Matrix Chain Multiplication problem. Other than this the Interviewer also asked me about OOPs concepts and requirement to solve the DSA questions using OOPs paradigms.

1. Zigzag Binary Tree Traversal

Easy
10m average time
90% success
0/40
Asked in companies
Goldman SachsAmazon

You are given a ‘Binary Tree’.


Return the level-order traversal of the Binary Tree.


Example:
Input: Consider the following Binary Tree:

Example

Output: 
Following is the level-order traversal of the given Binary Tree: [1, 2, 3, 5, 6, 4]


Problem approach

1. We can use a deque to solve the problem. 
2. Push and pop in different ways depending on if the level is odd or level is even.
3. Maintain a flag for the odd/even level

Try solving now

2. Matrix Chain Multiplication

Moderate
40m average time
60% success
0/80
Asked in companies
WalmartInfo Edge India (Naukri.com)Morgan Stanley

Given a chain of matrices A1, A2, A3,.....An. Your task is to find out the minimum cost to multiply these matrices. The cost of matrix multiplication is defined as the number of scalar multiplications. A Chain of matrices A1, A2, A3,.....An is represented by a sequence of numbers in an array ‘arr’ where the dimension of 1st matrix is equal to arr[0] * arr[1] , 2nd matrix is arr[1] * arr[2], and so on.

For example:

For arr[ ] = { 10, 20, 30, 40}, matrix A1 = [10 * 20], A2 = [20 * 30], A3 = [30 * 40]

Scalar multiplication of matrix with dimension 10 * 20 is equal to 200.
Problem approach

We can solve the problem using DP as:
1. Iterate from l = 2 to N-1 which denotes the length of the range:
1.1 Iterate from i = 0 to N-1:
1.2 Find the right end of the range (j) having l matrices.
1.2.1 Iterate from k = i+1 to j which denotes the point of partition.
1.2.2 Multiply the matrices in range (i, k) and (k, j).
1.2.3 This will create two matrices with dimensions arr[i-1]*arr[k] and arr[k]*arr[j].
1.2.4 The number of multiplications to be performed to multiply these two matrices (say X) are arr[i-1]*arr[k]*arr[j].
1.2.5 The total number of multiplications is dp[i][k]+ dp[k+1][j] + X.

The value stored at dp[1][N-1] is the required answer.

Try solving now
03
Round
Easy
Face to Face
Duration60 mintues
Interview date21 Nov 2022
Coding problem2

This was a core subject based round where the interviewer asked about various open-ended questions on Operating Systems. I was also asked about the previous internship experience and was asked to design a REST based API and how I would address the resources.

1. Technical Questions

Describe about locking mechanisms. How do Semaphores and mutex locks differ. How would you find the maximum number in the product of 2 matrices, would it require semaphores, how would you parallelize the solution.

Problem approach

Tip 1 : Try to explain the reasoning behind the solution and the problems you are facing in optimization of open-ended questions.
Tip 2 : Practice standard OS questions apart from theory, such as designing LRU cache etc.
Tip 3 : For parallel computing, try to break down the problem into individual, independent tasks and present the solution along with a dependency graph.

2. System Design Question

Design a REST API to store the details of the user along with preferred mobile number and other mobile numbers.

Problem approach

Tip 1 : Try to look at the problem with a theoretical aspect, such as treating endpoints as OOPs entities
Tip 2 : Be thorough with your resume and practice Ad-hoc problems based on the technologies you have written in your resume
Tip 3 : Take time to present any solution with justification and try to adhere to conventions as much as possible and include real life examples.

04
Round
Easy
Face to Face
Duration90 minutes
Interview date21 Nov 2022
Coding problem1

This round was a technical + HR + Managerial round. This included questions such as my motivation to join Morgan Stanley and questions based on my resume and projects.

1. Technical Questions

I was asked about my projects and the technologies I used, as well as how I would extend them. I was also asked to draw parallels with other real-world examples for the OOPs based inheritence.

Problem approach

Tip 1 : Try to be thorough with your project and understand the underlying Technolgies as well.
Tip 2 : Make sure if your projects are relating to core subjects that you understand the fundamentals of that core subject really well.
Tip 3 : Try to include real world analogies when presenting a solution, especially OOPs based solution.

Here's your problem of the day

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

Skill covered: Programming

Suppose list1 is [2, 133, 12, 12], what is max(list1) in Python?

Choose another skill to practice
Start a Discussion
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
522 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Morgan Stanley
507 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
105411 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
50292 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
31315 views
6 comments
0 upvotes