Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

Morgan Stanley interview experience Real time questions & tips from candidates to crack your interview

Morgan Stanley

3 rounds | 7 Coding
problems

Preparation

Duration: 6 months

Topics: Data Structures,Algorithms,Operating System,DBMS,OOPS concept,Low Level Design

Tip

Tip 1 : Practice all the data structures thoroughly and know about the basic concepts behind them and their use cases in real world.

Tip 2 : Be thorough with your resume .

Tip 3 : Be confident while answering the questions and be honest about your work.

Application process

Where: Campus

Eligibility: 7.5 CGPA and above

Resume tip

Tip 1 : Keep your resume crisp and to the point.

Tip 2 : Have a thorough understanding of the technologies used in the project and why was that specific technology chosen.

01

Round

Medium

Online Coding Interview

Duration120 minutes

Interview date1 Sep 2020

Coding problem2

There were three sections in the online test:-

1)First section consisted of Aptitude MCQ questions .

2)Second section was the debugging part which required to debug a piece of code.

3)Third section had 3 programming questions.

```
A pair ('ARR[i]', 'ARR[j]') is said to be an inversion when:
1. 'ARR[i] > 'ARR[j]'
2. 'i' < 'j'
Where 'i' and 'j' denote the indices ranging from [0, 'N').
```

```
N=3
```

```
We can climb one step at a time i.e. {(0, 1) ,(1, 2),(2,3)} or we can climb the first two-step and then one step i.e. {(0,2),(1, 3)} or we can climb first one step and then two step i.e. {(0,1), (1,3)}.
```

02

Round

Medium

Video Call

Duration60 minutes

Interview date3 Sep 2020

Coding problem4

This round started with my introduction and a brief discussion on the technologies I used in my project. After this, the interviewer asked me 3 coding questions and one low-level design question.

```
a) Duplicate elements may be present.
b) If no such element is present return -1.
```

```
Input: Given a sequence of five numbers 2, 4, 5, 6, 8.
Output: 6
Explanation:
In the given sequence of numbers, number 8 is the largest element, followed by number 6 which is the second-largest element. Hence we return number 6 which is the second-largest element in the sequence.
```

Problem approach

I traversed the array twice. In the first traversal, I found the maximum element. In the second traversal I found the greatest element less than the element obtained in the first traversal.

```
1. Every train will depart on the same day and the departure time will always be greater than the arrival time. For example, A train with arrival time 2240 and departure time 1930 is not possible.
2. Time will be given in 24H format and colons will be omitted for convenience. For example, 9:05AM will be given as "905", or 9:10PM will be given as "2110".
3. Also, there will be no leading zeroes in the given times. For example, 12:10AM will be given as “10” and not as “0010”.
```

Problem approach

I took a variable to count the number of platforms required at a particular time and a final ans variable. I took 2 arrays one for arrival time and the other for departure time and sorted both the arrays. Then I took 2 pointers at the start of each array and compared the timings pointed by the 2 variables. If the smallest time was of arrival I incremented my count variable otherwise decremented it and incremented the pointer of the smallest time. Every time I changed the count variable I compared it with my final ans variable, if its value is greater than my answer I updated my answer, and finally returned my answer variable.

```
Input: Consider the binary tree A as shown in the figure:
```

```
Output: [10, 5, 3, 7, 18, 25, 20]
Explanation: As shown in the figure
The nodes on the left boundary are [10, 5, 3]
The nodes on the right boundary are [10, 20, 25]
The leaf nodes are [3, 7, 18, 25].
Please note that nodes 3 and 25 appear in two places but are considered once.
```

Problem approach

First I printed the left-most boundary of the tree, then I printed all the leafs of the tree, and then the rightmost boundary in reverse order using recursion.

I was asked to design a parking lot in which there were 3 vehicles of small, medium, and large size. There were 3 types of slots for the vehicles small, medium, and large size. The small-sized vehicle can be parked in any of the 3 types of lots, medium-sized vehicles can be parked in only medium and large-sized lot and the large vehicles can be parked in a large-sized lot only. I had to design an efficient way to park the vehicles.

Problem approach

I created 3 maps for small, medium, and large-sized parking lots and classes for the vehicles and the parking lots using OOPS concepts. I created a function that took a vehicle for parking and looked for the smallest parking lot in which it can fit, if the smaller parking lot was not available I looked for the bigger ones and so on.

03

Round

Medium

HR Round

Duration45 minutes

Interview date5 Sep 2020

Coding problem1

This Round was a Technical + HR round which consisted of one coding question and some general HR Questions like what are your strengths and weeknesses and why do you want to join Morgan Stanley.

```
If the given string is 56789, then the next greater number is 56798. Note that although 56790 is also greater than the given number it contains 1 '0' which is not in the original number and also it does not contain the digit '8'.
```

```
The given string is non-empty.
If the answer does not exist, then return -1.
The given number does not contain any leading zeros.
```

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

How do you write a single-line comment in C++?

Choose another skill to practice

Start a Discussion

Similar interview experiences

SDE - 1

2 rounds | 4 problems

Interviewed by Morgan Stanley

0 views

0 comments

0 upvotes

Software Engineer

2 rounds | 6 problems

Interviewed by Morgan Stanley

605 views

0 comments

0 upvotes

Technology Analyst

2 rounds | 6 problems

Interviewed by Morgan Stanley

639 views

0 comments

0 upvotes

SDE - 1

3 rounds | 6 problems

Interviewed by Morgan Stanley

486 views

0 comments

0 upvotes

Companies with similar interview experiences

Digital Technology Intern

2 rounds | 6 problems

Interviewed by Tata Consultancy Services (TCS)

437 views

0 comments

0 upvotes