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

Technology Analyst

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

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, Algorithms, OOPS, Operating Systems, Aptitude, Graphs
Tip
Tip

Tip 1 : Be thorough with your resume and projects
Tip 2 : Coding questions focussed more on Graphs
Tip 3 : Be very good with OOPS and aptitude

Application process
Where: Campus
Eligibility: 8 CGPA
Resume Tip
Resume tip

Tip 1 : Better to have end to end/ full stack projects on the resume
Tip 2 : Better to have a one page resume

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date25 Aug 2021
Coding problem3

The first round was conducted on Mettl platform in the evening and consisted of 3 sections:
First section was aptitude - This consisted of Medium to Hard level questions and we had time constraint for this section.
Second section was the debugging section - The questions were Easy to Medium level and we were given code snippets and had to changes to the code snippets to make the round running, identify the incorrect syntax.
Third section consisted of 3 coding questions - Easy to medium level questions which consisted of 60 minutes.

1. Longest Subarray Zero Sum

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

Ninja loves playing with numbers. So his friend gives him an array on his birthday. The array consists of positive and negative integers. Now Ninja is interested in finding the length of the longest subarray whose sum is zero.

Problem approach

We create a hashmap which will store the key value pairs(key is the sum and value is the index in the array). So now we iterate through the array and calculate the sum one by one and update the hashmap. For eg. if the sum of first 3 elements is x, and the sum of first 7 element is also x, then this means that the sum from 3rd element to 7th element is 0. So we maintain a variable called maxlen(this contains the length of the array whose sum is 0), now compare the current length(7-3) with the maxlen and update the maxlen variable accordingly. maxlen = max(maxlen,current index-index in the hashmap) and finally return the maxlen variable.

Try solving now

2. Faulty Keyboard

Easy
0/40
Asked in companies
Morgan StanleyAdobe

Ninja has an old keyboard, which is now a piece of junk, but Ninja still loves it.

There is a major problem with the keyboard, pressing a single key can type the same character multiple times. This sometimes results in incorrect text being typed.

You are given two strings ‘Expected’ and ‘Typed’, you need to tell if the actual text was typed correctly or not. The text is typed correctly if some characters were long pressed (typed multiple times) while typing the ‘Expected’ text. Print “true” if the actual text was typed correctly, else print “false”.

For Example :
If Typed = “aaabcc” and Expected = “abc”

Then, while trying to type “abc” one might long press ‘a’ and that would result in typing three consecutive a’s. This if followed by correctly pressing ‘b’ once and in the end he might long press ‘c’ resulting in typing it twice, the resulting text typed in this case is equal to “aaabcc” and therefore we will return “true”.
Try solving now

3. Reachable nodes in the new graph

Moderate
20m average time
80% success
0/80
Asked in companies
Morgan StanleyAmazonSYSVINE

You are given an undirected graph with ‘n’ nodes labeled from ‘0’ to ‘n - 1’. The graph is given in as an array of ‘edges’, where ‘edges[i] = [u, v, sz]’ means there is an edge between node ‘u’ and ‘v’ in the given graph. Create a new graph by replacing the edge between ‘u’ and ‘v’ with a chain of size ‘sz’.

To create a chain of size ‘sz’ between nodes ‘(u, v)’, create ‘sz’ new nodes and ‘sz + 1’ new edges. The new nodes are ‘X1, X2, … , Xsz’ and the new edges are ‘(u, X1), (X1, X2), (X2, X3), … , (X(sz-1), Xsz), (Xsz, v)’.

A node is reachable from node ‘0’ if it’s at a distance of less than or equal to ‘m’ edges. Your task is to find the number of nodes reachable from node ‘0’ in the new graph.

Example:
‘n = 3’, ‘m = 4’
‘edges = [ [0, 2, 8], [0, 1, 1], [1, 2, 0] ]’

example

The reachable nodes are highlighted in red color. So, the answer is ‘9’. Node ‘0’, itself included in the answer.  
Note:
1. For an edge ‘[u, v, sz]’, if ‘sz = 0’, then there is no chain, and ‘(u, v)’ is an edge in the new graph.

2. The graph doesn’t contain parallel edges or self-loops.
Try solving now
02
Round
Easy
Face to Face
Duration45 minutes
Interview date27 Aug 2021
Coding problem3

This round was focussed on graphs and operating systems. For the coding questions they asked me to explain the approach and code it. OS questions were standard and straight forward.

1. Count Strongly Connected Components (Kosaraju’s Algorithm)

Hard
40m average time
65% success
0/120
Asked in companies
Morgan StanleyMedia.netAtlassian

You are given an unweighted directed graph having 'V' vertices and 'E' edges. Your task is to count the number of strongly connected components (SCCs) present in the graph.

A directed graph is said to be strongly connected if every vertex is reachable from every other vertex. The strongly connected components of a graph are the subgraphs which are themselves strongly connected.

Note :
Use zero-based indexing for the vertices.

The given graph doesn’t contain any self-loops.
Problem approach

The problem was to find the number of families or components in the graph. So I used the DFS approach for this. I maintain a variable called components and I start the DFS from vertex 0 and run DFS one by one. Whenever DFS stops then this means that it has explored all the vertices in the particular component so we increase the components variable by 1. So similarly run DFS for all the vertices and check the number of components, keep incrementing the components variable.

Try solving now

2. Operating System Question

What are the different states of a process? How is multitasking done in real world scenarios?

Problem approach

Tip 1 : We need to have a good understanding of the different stages of a process.
Tip 2 : Do prepare all the standard questions of OS thoroughly. For eg. semaphores, mutex, multithreading etc.
Tip 3 : Practice all the answers for these standard questions before the interview.

3. Operating System Question

Explain the difference between multiprocessing and multithreading?

Problem approach

Tip 1 : We need to have a good understanding of the different stages of a process.
Tip 2 : Do prepare all the standard questions of OS thoroughly. For eg. semaphores, mutex, multithreading etc.
Tip 3 : Practice all the answers for these standard questions before the interview.

03
Round
Medium
HR Round
Duration45 minutes
Interview date27 Aug 2021
Coding problem3

This round consisted of an OOPS question, standard HR questions and a System Design question.

1. OOPS Question

Explain about the diamond problem of OOPS?


 

Problem approach

Tip 1 : Be very thorough with OOPS concepts(stick to one language, I chose C++ and explore all the concepts)
Tip 2 : Not only concepts, but be prepared for coding the classes and functions as well
Tip 3 : Learn about the edge cases and exceptions

2. System Design Question

Design Flipkart Application. Explain the different sections, the flow of the website and the data structures used everywhere.


 

Problem approach

Tip 1 : Be prepared for the common questions of System Design such as Design Twitter, Parking Lot etc
Tip 2 : Don't skip System Design as LLD has become common even for SDE-1 interviews
Tip 3 : Not only theory, but we should but able to code our approach as well

3. Basic HR Questions

Why should we hire you?

Why do you want to join the company?

What's your vision in the next 5 years?

Problem approach

Tip 1 : Be prepared for a good introduction
Tip 2 : Be confident about your resume
Tip 3 : Better to prepare for all the standard questions of HR

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
Technology Analyst
5 rounds | 13 problems
Interviewed by Morgan Stanley
932 views
0 comments
0 upvotes
company logo
Technology Analyst
3 rounds | 7 problems
Interviewed by Morgan Stanley
5103 views
0 comments
0 upvotes
company logo
Technology Analyst
2 rounds | 3 problems
Interviewed by Morgan Stanley
1433 views
0 comments
0 upvotes
company logo
Technology Analyst
2 rounds | 6 problems
Interviewed by Morgan Stanley
981 views
0 comments
0 upvotes