Trees and Graphs
Trees and graphs make up a smaller share of the coding at Morgan Stanley, but they still turn up, on the campus assessment, in live campus rounds and up to senior lateral loops.
None of these needs more than BFS, DFS or an in-degree count. The tree problems give you the input as a level-order list with null for a missing child, so you build the tree first. All three tree problems share that format, so write the parser once, reuse it, and test it on a lopsided tree.
For the graph problem, decide which way each dependency points before you write the loop. Then count in-degrees and keep taking the nodes that have none left.
Morgan StanleyPremium lesson · Coding round
The 4 Morgan Stanley problems are below.
- A Premium questionCoding · Medium
- A Premium questionCoding · Medium
- A Premium questionCoding · Medium
+ 1 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the Morgan Stanley questions$49 a year · all 100 companies · cancel anytime
From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.
Morgan Stanley interview guideKnow what Morgan Stanley asks before you walk in.
33 coding · 4 system design · 19 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.