# Interview Experience of SDE-Morgan Stanley

Status: Technology Associate at Morgan Stanley
Location: Bangalore, India

The recruitment process consisted of 4 rounds :

Online Coding Test (2 hours)

The first round was an online test on Hackerrank. It contained 20 MCQs related to Computer Science topics like OS, Data Structure and Algorithms, Databases, and Computer Networking. There were 20 more MCQs related to aptitude and verbal reasoning topics.
In the end, it had 2 coding questions with one medium and one hard level of difficulty.

Coding Problem 1 - Given a string find the minimum length substring which contains all the characters that are present in the string.
For example:
string = “abcaab” ,
Output = “abc”
The minimum length substring is “abc” since it contains all the unique characters that the string contains.

Solution - I used the sliding window approach. I first stored the frequency of each character in the string in an array. Then used the two-pointer sliding window approach to find the substring.

Coding Problem 2 - Given strings s and t, find the minimum (contiguous) substring w of s, so that t is a subsequence of w.
s = “abcdebdde”, t = “bde”
Output = “bcde”

Solution - There wasn’t enough time left so I applied the brute force method and a few test cases passed.

Technical Interview 1 (45 minutes)

The interview started with asking some OS questions like Multiprocessing, Process Scheduling, etc. Then he asked about a knapsack-like problem that can be solved by Dynamic Programming. Finally, he asked a question about the binary tree. The question was given a binary tree to find all the paths from the root to all the leaf nodes.

Technical Interview 2 (1 hour)

The guy who took my interview was very cool. He started by asking me to discuss a few of my projects. Then he asked about a system design problem. The problem was to design an amazon like service which can display products to be sold and offers if any, ratings and the number of customers who bought this product, etc. He gave me some queries and asked me to design them in a way so that these queries are optimized. I started with a simple database design that had only two tables and slowly tried to split it into multiple tables so that the given queries can be run in an optimized way.

HR Interview 3 (45 minutes)

The interview started with usual HR questions like “Tell me about yourself”, “hobbies” etc., and then “Why do you want to join the company” and “What do you know about the company” etc.
I asked the interviewer a little bit more about what they do and who are their clients etc.