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

Technology Analyst

Morgan Stanley
upvote
share-icon
5 rounds | 13 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS, Operating Systems, DBMS
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
Easy
Coding Test - Pen and paper
Duration75 minutes
Interview date15 Sep 2015
Coding problem0

This was a written test with 50 Objective type questions.

02
Round
Easy
Face to Face
Duration60 minutes
Interview date15 Sep 2015
Coding problem7

This was a technical round with questions on DSA and OOPS.

1. Technical Question

What is AVL Tree?

Problem approach

AVL tree is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees cannot be more than one for all nodes.

2. Technical Question

Why is the time complexity of Binary Search O(Logn)?

Problem approach

Let say the iteration in Binary Search terminates after k iterations. 
At each iteration, the array is divided by half. So let’s say the length of array at any iteration is n
At Iteration 1 : 
Length of array = n
At Iteration 2 : 
Length of array = n⁄2
At Iteration 3: 
Length of array = (n⁄2)⁄2 = n⁄22
Therefore, after Iteration k : 
Length of array = n⁄2k

Also, we know that after 
After k iterations, the length of array becomes 1. Therefore , 
Length of array = n⁄2k=1
=> n = 2k
Applying log function on both sides: 
=> log2 (n) = log2 (2k)
=> log2 (n) = k log2 (2)

As (loga (a) = 1) 
Therefore, => k = log2 (n)

3. Implement a priority queue

Moderate
0/80
Asked in companies
AmazonOracleOYO

You have to implement the pop function of Max Priority Queue and implement using a heap.


Functions :
a) push(int x) : 'x' has to be inserted in the priority queue. This has been implemented already

b) pop() : return the maximum element in the priority queue, if priority queue is empty then return '-1'.


Example:
We perform the following operations on an empty priority queue:

When operation push(5) is performed, we insert 1 in the priority queue.

When operation push(2) is performed, we insert 2 in the priority queue. 

When operation pop() is performed, we remove the maximum element from the priority queue and print which is 5.

When operation push(3) is performed, we insert 1 in the priority queue.

When operation pop() is performed, we remove the maximum element from the priority queue and print which is 3.
Problem approach

Priority Queues can be implemented using common data structures like arrays, linked-lists, heaps and binary trees. Here we are using a linked list.
The list is built up in such a way that the element with the highest priority is always at the top. The elements are listed in descending order of priority in the list. This allows us to remove the element with the highest priority in O(1) time. To insert an element, we must scan the list and identify the appropriate location in which to place the node so that the priority queue's overall order is maintained.

Algorithm : 
PUSH(HEAD, DATA, PRIORITY) 
Step 1: Create new node with DATA and PRIORITY 
Step 2: Check if HEAD has lower priority. If true follow Steps 3-4 and end. Else goto Step 5. 
Step 3: NEW -> NEXT = HEAD 
Step 4: HEAD = NEW 
Step 5: Set TEMP to head of the list 
Step 6: While TEMP -> NEXT != NULL and TEMP -> NEXT -> PRIORITY > PRIORITY 
Step 7: TEMP = TEMP -> NEXT 
[END OF LOOP] 
Step 8: NEW -> NEXT = TEMP -> NEXT 
Step 9: TEMP -> NEXT = NEW 
Step 10: End
POP(HEAD) 
Step 2: Set the head of the list to the next node in the list. HEAD = HEAD -> NEXT. 
Step 3: Free the node at the head of the list 
Step 4: End
PEEK(HEAD): 
Step 1: Return HEAD -> DATA 
Step 2: End

Try solving now

4. Sum of Digits

Easy
15m average time
85% success
0/40
Asked in companies
ArcesiumUberSamsung

Ninja is given an integer ‘N’. One day Ninja decides to do the sum of all digits and replace the ‘N’ with the sum of digits until it becomes less than 10. Ninja wants to find what will be the value of ‘N’ after applying this operation.

Help Ninja in finding out this value.

Problem approach

Algorithm : 
1. Declare a variable to store the sum and set it to 0
2. Repeat the next two steps till the number is not 0
3. Get the rightmost digit of the number with help of the remainder ‘%’ operator by dividing it by 10 and add it to sum.
4. Divide the number by 10 with help of ‘/’ operator to remove the rightmost digit.
5. Return the sum

Try solving now

5. OOPS Question

Difference between Hashmap and Hashset

Problem approach

1. Hash Set implements Set interface while hash map implements Map interface . 
2. No duplicates allowed in hash set. In hash map, duplicates values are allowed but no duplicate key is allowed 
3. Only 1 Object is required during an add operation for hash set while 2 objects are required for hash map. 
4. Hash set uses a hash map object for adding and storing mechanism while hashmap uses a hashing technique. 
5. Hash set is comparatively slower than HashMap

6. OOPS Question

Difference between Abstract Class and Interface

Problem approach

1) Abstract class can have abstract and non-abstract methods. Interface can have only abstract methods. Since Java 8, it can have default and static methods also.
2) Abstract class doesn't support multiple inheritance. Interface supports multiple inheritance.
3) Abstract class can have final, non-final, static and non-static variables. Interface has only static and final variables.
4) Abstract class can provide the implementation of interface. Interface can't provide the implementation of abstract class.
5) The abstract keyword is used to declare abstract class. The interface keyword is used to declare interface.
6) An abstract class can extend another Java class and implement multiple Java interfaces. An interface can extend another Java interface only.

7. OOPS Question

Why are virtual destructors needed?

Problem approach

Virtual destructors in C++ are used to avoid memory leaks especially when your class contains unmanaged code, i.e., contains pointers or object handles to files, databases or other external objects. A destructor can be virtual.

03
Round
Medium
Face to Face
Duration60 minutes
Interview date15 Sep 2015
Coding problem4

This was a technical round with questions on OS and OOPS. A design question was also discussed.

1. OS Question

What is Round Robin Algorithm?

Problem approach

In Round-robin scheduling, each ready task runs turn by turn only in a cyclic queue for a limited time slice. This algorithm also offers starvation free execution of processes.
The name of this algorithm comes from the round-robin principle, where each person gets an equal share of something in turns. It is the oldest, simplest scheduling algorithm, which is mostly used for multitasking.

2. System Design Question

Build a system where people subscribe to a particular topic . And if any message is posted regarding the particular topic then the people who have subscribed to that system must get the message

Problem approach

Tip 1: Firstly, remember that the system design round is extremely open-ended and there’s no such thing as a standard answer. Even for the same question, you’ll have a totally different discussion with different interviewers.
Tip 2: Before you jump into the solution always clarify all the assumptions you’re making at the beginning of the interview. Ask questions to identify the scope of the system. This will clear the initial doubt, and you will get to know what are the specific detail interviewer wants to consider in this service.
Tip 3: Design your structure and functions according to the requirements and try to convey your thoughts properly to the interviewer so that you do not mess up while implementing the idea .

3. Technical Question

How is memory allocation done in recursion?

Problem approach

When a function is called, its memory is allocated on a stack. Stacks in computing architectures are the regions of memory where data is added or removed in a last-in-first-out (LIFO) process. Each program has a reserved region of memory referred to as its stack. When a function executes, it adds its state data to the top of the stack. When the function exits, this data is removed from the stack.

4. OS Question

Why are threads needed ?

Problem approach

It takes far less time to create a new thread in an existing process than to create a new process.
Threads can share the common data, they do not need to use Inter- Process communication.
Context switching is faster when working with threads.
It takes less time to terminate a thread than a process.

04
Round
Easy
Group Discussion
Duration45 minutes
Interview date16 Sep 2015
Coding problem1

This was a group activity round.

1. Group Activity

Here, they gave us some wooden blocks and crayons and asked us to make a logo for Morgan Stanley and prepare a slogan individually which shows the technological development of MS with collaboration with Clients .

05
Round
Easy
HR Round
Duration30 minutes
Interview date16 Sep 2015
Coding problem1

HR round with typical behavioral problems.

1. Basic HR Questions

Q1. Projects which I did in the academic years .
Q2. Then he asked me that your idea was not brought into the group activity but still you said you will be the leader and How would I accept it ?
Q3. Then he asked whom will you eliminate from that group?
Q4. Questions based on Resume

Problem approach

Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the work environment etc.

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
Technology Analyst
4 rounds | 11 problems
Interviewed by Morgan Stanley
838 views
0 comments
0 upvotes
company logo
Technology Analyst
3 rounds | 7 problems
Interviewed by Morgan Stanley
5103 views
0 comments
0 upvotes
company logo
Technology Analyst
2 rounds | 3 problems
Interviewed by Morgan Stanley
1433 views
0 comments
0 upvotes
company logo
Technology Analyst
2 rounds | 6 problems
Interviewed by Morgan Stanley
982 views
0 comments
0 upvotes