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

Software Developer

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

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS
Tip
Tip

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date22 May 2015
Coding problem3

There were 33 questions in total. The objective questions were simple.

1. Sort Big List Dates

Moderate
20m average time
80% success
0/80
Asked in companies
Morgan StanleyJosh Technology Group

Mary is a party-loving girl of the 21st Generation. She loves to attend parties and events with her family and friends. But she is terrible at remembering the dates of these events.

Mary has a list of dates of these events. Can you help her sort the list of dates to be easier for Mary to track the parties?

You are given an array ‘dates’ consisting of ‘N’ dates. You have to sort this array and print the array in sorted order.

For example:
If dates= [ [13,6,2007] , [2,6,2001] , [10,8,2019] , [1,6,2007] ]
Sorted Order of Dates will be :
dates = [ [ 2,6,2001] , [1,6,2007] , [13,6,2007] ]  
Problem approach

Custom sorting can be used here. Extract the days, months and years as sub-strings from the string then compare two strings by years, if years for two dates are equal then compare their months. If months are also equal than the days will decide which date appears earlier in the calendar.

Time Complexity: O(N * log(N)) 
Auxiliary Space: O(1)

Try solving now

2. Pair Sum

Easy
15m average time
90% success
0/40
Asked in companies
Media.netExpedia GroupQuikr

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.

Note:

Each pair should be sorted i.e the first value should be less than or equals to the second value. 

Return the list of pairs sorted in non-decreasing order of their first value. In case if two pairs have the same first value, the pair with a smaller second value should come first.
Problem approach

The problem can be solved in O(n) time using hashing. 
Use a hashset to check for the current array value. Check if targetsum – current value exists in the map or not. If it exists, that means a pair with sum equal to target sum exists in the array.

Try solving now

3. Maximum Sum Problem

Easy
15m average time
85% success
0/40
Asked in company
Morgan Stanley

You are given a number N that can be broken into three parts N / 2, N / 3, and N / 4 (considering only integer parts). Each number obtained in this process can be divided further recursively. Your task is to find the maximum sum that can be obtained by summing up the divided parts together.

Note:
The maximum sum may be obtained without dividing N also.
For example :
N = 12 breaking N into three parts will give 6, 4, and 3 which gives us the sum = 13. Further breaking 6, 4, and 3 into other parts will give us a sum less than or equal to 6, 4, and 3 respectively. Therefore, the maximum answer will be 13.
Problem approach

Recursion can be used here. In each call, check only max((max(n/2) + max(n/3) + max(n/4)), n) and return it. Because either we can get maximum sum by breaking number in parts or number is itself maximum.

The efficient solution would be to use Dynamic programming because while breaking the number in parts recursively we have to perform some overlapping problems. Store values in an array and if for any number in recursive calls we have already solution for that number currently so we directly extract it from array. 

Pseudocode : 
breakSum(n)
{
int dp[n+1]; //create an array of size n+1

// base conditions
dp[0] = 0, dp[1] = 1;
// Fill in bottom-up manner using recursive formula.
for (i=2 to i=n) do : 
dp[i] = max(dp[i/2] + dp[i/3] + dp[i/4], i);

return dp[n];
}

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 remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
Software Developer
2 rounds | 6 problems
Interviewed by Morgan Stanley
1093 views
0 comments
0 upvotes
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
1057 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Morgan Stanley
903 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Developer
5 rounds | 14 problems
Interviewed by Microsoft
4029 views
1 comments
0 upvotes
company logo
Software Developer
6 rounds | 12 problems
Interviewed by SAP Labs
2912 views
0 comments
0 upvotes
company logo
Software Developer
3 rounds | 3 problems
Interviewed by Amazon
1271 views
0 comments
0 upvotes