Morgan Stanley coding interviews: 4 problems you could face
Preparing for an engineering interview at a bank can be difficult. With so many possible problems available to practice on Leetcode and Hackerrank and only so much time before your interview, you can't do them all.
If you're interviewing at Morgan Stanley however, you're in luck. These four questions have all seemingly been given to interviewees at the bank in 2023.
1. NGO Tasks
A UK based engineer reported this question on Leetcode during February. It loosely goes as follows:
'A Non-Governmental-Organization has N members with IDs from 1 to N. Previously, members would perform similar service activities during weekends.
A new rule has been put in place, with the NGO deciding to do X new types of activities. The activities performed before now have the ID of 0.
For Y hours during weekends, a group of members with consecutive member IDs are selected to perform X new activity types. Members not selected during that hour will perform the previous types of activities.
The NGO head needs to find the maximum number of members performing a certain activity type for every Y working hours. Write an algorithm to figure this out.'
Multiple respondents were rather critical of the questions wording, unsure of how to go about it, but one user in the comments suggested this solution:
2. Office Printers
An anonymous Leetcode user also reported encountering this Morgan Stanley coding problem in February:
'An office has four floors, with each floor having four printers. A user should be able to print using any of the four printers on their floor.
A printer queue should not have more than N jobs.
There are two types of printer. Colored and B&W. The B&W printer can only print B&W jobs but the colored printer can print both coloured and B&W jobs.'
The question is a low level design one, and involves coding a system for queueing prints that follows these rules.
3. Cut them all
Another Leetcode user gave two questions from their recent Morgan Stanley interview, both focused on dynamic programming and subsequences. The first can be seen below:
4. Subsequence Removal
The second of the two problems from this interviewee focuses on removing subsequences from an array, presenting the result when there are no duplicate integers.
One of the respondents suggested the following code as a solution:
Have a confidential story, tip, or comment you’d like to share? Contact: email@example.com in the first instance.
Bear with us if you leave a comment at the bottom of this article: all our comments are moderated by human beings. Sometimes these humans might be asleep, or away from their desks, so it may take a while for your comment to appear. Eventually it will – unless it’s offensive or libelous (in which case it won’t.)