Discover your dream Career
For Recruiters

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:

Click here to create a profile on eFinancialCareers. Comment ANONYMOUSLY on articles and make yourself visible to recruiters hiring for top jobs in technology and finance. 

Have a confidential story, tip, or comment you’d like to share? Contact: alex.mcmurray@efinancialcareers.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.)

author-card-avatar
AUTHORAlex McMurray Editor
  • ph
    photobug56
    5 April 2023

    I'm curious - what does a firm learn about a candidate with such mathematical problems? I'm not saying that there shouldn't be coding tests for new programmers are hired into a firm, but what do these test accomplish? And yes, when I started coding at a bank about 40 years ago, I went through a coding test. I realized that in that case, the real question to be solved - can the candidate follow simple instruction? I passed, and later was assigned to test new candidates, and what amazed me most was that most coding candidates simply didn't follow the instructions, which were very easy and straight forward.

Sign up to our Newsletter

The essential daily roundup of news and analysis read by everyone from senior bankers and traders to new recruits.

Boost your career

Find thousands of job opportunities by signing up to eFinancialCareers today.
Recommended Jobs
Paritas Recruitment - Data & Tech
Quantitative Researcher (Systematic Fund)
Paritas Recruitment - Data & Tech
London, United Kingdom
Oxford Knight
Data Analyst - London- Quant Trading
Oxford Knight
London, United Kingdom
PER, Private Equity Recruitment
Investment Analyst, Public Equities, Investment Firm, Dubai, UAE
PER, Private Equity Recruitment
Dubai, United Arab Emirates
Garrison Associates, LLC
Quantitative Developer
Garrison Associates, LLC
Manhattan, United States

Sign up to our Newsletter

The essential daily roundup of news and analysis read by everyone from senior bankers and traders to new recruits.