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

Digital Technology Intern

Morgan Stanley
upvote
share-icon
3 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures,Algorithms,Operating System,DBMS,OOPS concept,Low Level Design
Tip
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
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.

Interview rounds

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.

1. Count Inversions

Moderate
40m average time
55% success
0/80
Asked in companies
AmazonMicrosoftInfosys

For a given integer array/list 'ARR' of size 'N' containing all distinct values, find the total number of 'Inversions' that may exist.

An inversion is defined for a pair of integers in the array/list when the following two conditions are met.

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').
Try solving now

2. Count Ways To Reach The N-th Stairs

Moderate
30m average time
80% success
0/80
Asked in companies
GoogleInfosysJP Morgan

You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair.


Each time, you can climb either one step or two steps.


You are supposed to return the number of distinct ways you can climb from the 0th step to the Nth step.

Example :
N=3

Example

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)}.
Try solving now
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.

1. Second largest element in the array

Easy
15m average time
80% success
0/40
Asked in companies
AdobeTata Consultancy Services (TCS)Samsung

You have been given an array/list 'ARR' of integers. Your task is to find the second largest element present in the 'ARR'.

Note:
a) Duplicate elements may be present.

b) If no such element is present return -1.
Example:
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.

Try solving now

2. Minimum Number of Platforms

Moderate
30m average time
70% success
0/80
Asked in companies
AmazonDunzoAtlassian

You have been given two arrays, 'AT' and 'DT', representing the arrival and departure times of all trains that reach a railway station.

Your task is to find the minimum number of platforms required for the railway station so that no train needs to wait.

Note :
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.

Try solving now

3. Boundary Traversal

Hard
20m average time
85% success
0/120
Asked in companies
MicrosofteBaySalesforce

You are given a binary tree having 'n' nodes.


The boundary nodes of a binary tree include the nodes from the left and right boundaries and the leaf nodes, each node considered once.


Figure out the boundary nodes of this binary tree in an Anti-Clockwise direction starting from the root node.


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

alt text

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.

Try solving now

4. System Design

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.

1. Next Greater Number

Moderate
15m average time
90% success
0/80
Asked in companies
Morgan StanleySamsungArcesium

You are given a string S which represents a number. You have to find the smallest number strictly greater than the given number which contains the same set of digits as of the original number i.e the frequency of each digit from 0 to 9 should be exactly the same as in the original number.

For example:
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'.

Note:

The given string is non-empty.

If the answer does not exist, then return -1.

The given number does not contain any leading zeros.
Try solving now

Here's your problem of the day

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

Skill covered: Programming

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

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Morgan Stanley
0 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 6 problems
Interviewed by Morgan Stanley
605 views
0 comments
0 upvotes
company logo
Technology Analyst
2 rounds | 6 problems
Interviewed by Morgan Stanley
639 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Morgan Stanley
486 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Digital Technology Intern
2 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
437 views
0 comments
0 upvotes