Morgan Stanley | Mumbai | 2021 | Macro Strata Team
Summary
I interviewed with Morgan Stanley for a position within their Strata team in Mumbai, going through a challenging five-round process. The interviews extensively covered data structures and algorithms, system design, object-oriented programming, and brainteasers, with specific questions on database concurrency, API optimization, and array manipulations. I successfully completed the first two rounds and was progressing to subsequent stages.
Full Experience
I was contacted by Morgan Stanley HR regarding a requirement in their Strata team, which focuses on building software for MS trading platforms. This involves very high traffic from all share markets, with lots of real-time data processing, where both availability and consistency are mandatory. Each interview round lasted 30 minutes.
First Round
The first interviewer was from London, a Cambridge graduate and a veteran in technology with 14 years at Morgan Stanley. The round started with an introduction and a discussion about my future prospects and plans. He then provided an overview of the MS team and their products, followed by a discussion on my language proficiency and current tech stack. Two specific questions were asked:
- What is a percentile, how do you calculate it? Given a list of marks with role numbers, find a given role number's percentile. We discussed related complexity and optimization.
- Given a 3x3 grid, count the number of ways to fill numbers 1-9 uniquely in the grid.
We also talked about my current project, its shortcomings, and areas for improvement. Database discussions included 'Mongo vs Postgres: what's the flaw with Mongo vs Postgres?', 'How can concurrency be achieved in Mongo?', and 'What is the single granular level of concurrency at the DB level we can target to achieve?'
Second Round
This 30-minute round was conducted by an interviewer from the Hong Kong office. After an introduction, I was asked a question about API optimization:
- In an API, how can we optimize sending a large amount of data efficiently? The API's efficiency relies on the size of the data sent in the response. The data being sent is a stream of numbers, in sorted order, e.g., 1,1,1,1,1,1,1,1,1,2,2,9,9, 13,13,13,...
Following this, we discussed what I look for while reviewing a PR and multiple ways to optimize code. The interviewer also gave an overview of their product, codebase, and internal tech stack. We talked about how things work internally at Morgan Stanley and the responsibilities and use cases of the Strata team. There were some more questions, but I don't recall them now. Overall, this round went very well, and the interviewer seemed completely satisfied.
The verdict for the second round was positive, and I am currently waiting for the third round. The total process consists of 5 rounds, so I have 3 more to go.
Third Round (Edit)
The third round, lasting 30 minutes, was with the global head of the Strata team, based in the London office. He introduced himself, his team, how various teams are connected globally, their tech stack, and team size. He then inquired about my background, projects, tech stack, and particularly my interest in moving towards the finance domain in technology. I was asked if I was aware of any finance-related terminologies:
- What's a bond? (I could provide a basic answer).
- Types of bonds? (I had no answer for this).
He then asked about my favorite languages (I mentioned Java, PHP, JavaScript, but he noted Python from my resume). We then delved into Python specifics:
- Difference between tuple and list and their use cases.
- Types of data we can store inside a tuple and list.
I was asked what things I would optimize first in an application for a better user experience, to which I mentioned space and time. He then dug deeper into Python lists and tuples:
- Among tuple and list, which one is more memory efficient and time efficient, and how?
- How is memory allocation done for list and tuple?
My knowledge of tuples and lists was basic, so he continued to dig deeper. He asked if I knew NumPy (I said no), then pivoted to Java:
- What is method overloading and overriding in Java?
- Public and private specifiers in Java and their use cases with an example.
The round concluded with an opportunity for me to ask questions.
Fourth Round
This 30-minute round took place with an interviewer from the Luxembourg office. After introductions, I was asked why I was changing jobs. The technical part included two brainteasers:
- A 10-step ladder: a person can move one or two steps at a time. Count the number of ways they can reach the 10th step.
- Current time is 3:00 PM in a clock. At which time will both the minute and hour hands meet? Calculate.
Followed by Java-specific questions:
- Time series data `{timestamp: array of numbers}`: how will you store this data?
- What does the `==` operator check?
- Method overloading vs. overriding.
- Does Java support multiple inheritance? Why or why not? How do you resolve the multiple inheritance problem in Java?
And a Data Structures question:
- Given an array of numbers and a number X. Find a subarray whose sum is greater than X. We discussed this in detail.
I then asked about how things operate within their team, including tasks, projects, releases, and other activities, which she explained thoroughly. The interviewer was very helpful and cooperative, making it a good experience.
Fifth Round
The final 30-minute round was with an interviewer from the Budapest office. He introduced himself and discussed the team structure. The round started with a brainteaser:
- There are 7 people and a 6-faced dice. We need to pick a loser with a roll of the dice. How do we pick? Follow up: Suppose there is a cost of rolling a dice, so we have to pick the loser with minimum rolls of dice.
Followed by a Computer Science question:
- Given two arrays, find their intersection. I initially proposed an O(n^2) solution, then optimized it to O(n) using a hashset. The interviewer gave follow-ups:
- What if both arrays are sorted? I mentioned a solution similar to merging two arrays in merge sort, achieving O(m+n) time and constant space.
- What if one array is significantly larger than the other (e.g., one has 1 million elements, and the other has only 20)? I mentioned performing a binary search for each of the 20 elements, which would result in O(20 log 1 million) complexity.
The round concluded with an opportunity for me to ask questions.
Interview Questions (24)
Explain what a percentile is and how to calculate it. Given a list of marks with corresponding role numbers, find the percentile for a given role number. Discuss complexity and optimization.
Given a 3x3 grid, count the number of ways to fill it with numbers 1 through 9 uniquely.
Discuss the differences between MongoDB and PostgreSQL, highlighting the flaws or weaknesses of MongoDB compared to PostgreSQL.
Explain how concurrency is achieved in MongoDB.
Describe the single most granular level of concurrency that can be targeted at a database level.
How can an API be optimized to send a large stream of sorted numbers efficiently? The API's efficiency is directly dependent on the size of the data sent in the response. Example data: 1,1,1,1,1,1,1,1,1,2,2,9,9, 13,13,13,...
What factors do you consider when reviewing a Pull Request? What are various strategies to optimize code?
Explain what a bond is and describe different types of bonds.
Explain the differences between Python lists and tuples, and their respective use cases.
What types of data can be stored inside Python lists and tuples?
What aspects would you prioritize for optimization in an application to improve user experience?
Compare the memory and time efficiency of Python lists and tuples, explaining the underlying reasons.
Explain how memory is allocated for Python lists and tuples.
Explain method overloading and method overriding in Java.
Describe the public and private access specifiers in Java, their use cases, and provide an example for each.
A person is climbing a 10-step ladder and can move either one or two steps at a time. Count the number of distinct ways they can reach the 10th step.
Given the current time is 3:00 PM, calculate the next time when both the minute and hour hands of a clock will meet.
Given time series data structured as {timestamp: array of numbers}, how would you store this data efficiently?
What does the == operator check in Java?
Explain the difference between method overloading and method overriding in Java.
Does Java support multiple inheritance? Explain why or why not, and how the multiple inheritance problem is typically resolved in Java.
Given an array of numbers and an integer X, find a subarray whose sum is greater than X. Discuss the approach in detail.
You have 7 people and a 6-faced die. How can you use the die to pick a 'loser'? Follow-up: Assuming there's a cost per die roll, how do you pick the loser with the minimum number of rolls?
Given two arrays, find their intersection. Discuss different approaches and their complexities.
Follow-up 1: What if both arrays are sorted?
Follow-up 2: What if one array is significantly larger than the other (e.g., one has 1 million elements, the other has 20)?