Intervals, Heaps and Greedy
Interval and heap problems come up in two places at Morgan Stanley. The campus assessment usually wraps a classic problem in a story, sometimes a different story each time. Lateral first rounds ask the same problems with no story at all, so your first job is to strip the wording and recognize which problem you're looking at.
Each of the four problems needs either a sort or a heap. Two sort and then sweep, one keeps a heap capped at a fixed size, and one saves options in a heap and draws on them only when it has to.
Before you code the interval problem, check whether ranges that only touch count as overlapping. Every problem below runs against real tests in six languages, so get your own version passing before you open the walkthrough.
Morgan StanleyPremium lesson · Coding round
The 4 Morgan Stanley problems are below.
- A Premium questionCoding · Medium · Signature problem
- A Premium questionCoding · Hard · Frequently asked
- 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.