Tip 1 : Practice the DSA questions from Code Studio which are already being asked by Morgan Stanley.
Tip 2 : Thoroughly go through your projects.
Tip 3 : Study Object Oriented Programming Concepts
Tip 1 : Have some good projects on your resume
Tip 2 : Do not put false things on your resume
It was late in the evening at 7PM and we had to complete it by 9PM.
Let 'S' is 121. Then the nearest integers are 111 and 131 which are palindrome. Both have the same absolute difference but 111 is smaller. Hence 111 is the answer.
Used the concept of Binary Search
Find the minimum number of edges to be removed such that no path exists between the given pair of vertices (Learn)
This round was taken by a manager. The interviewer was exceptionally helpful.
A “Zig-Zag” arrangement is an arrangement where the differences between successive numbers on tokens strictly alternate between positive and negative integers.
“3 8 5 9 4 7 2 6” is a “Zig-Zag” arrangement as the differences “5 -3 4 -5 3 -5 4” alternates between positive and negative.
The first difference (if one exists) may be either positive or negative.
The idea is to use a modified one pass of bubble sort. This means swapping elements if they are not in position.
The steps are as follows:
- Traverse the array, from 0th position to ‘N’-2th position.
- Maintain a bool variable ‘flag’ for representing which order currently we need, greater than or less than.
- If the current two elements, i.e., the element at ‘i’ and ‘i’+1th position, are not in that order, then swap those elements; otherwise, not.
- We will return ‘arr’ as the final answer.
Input: 'str' = "abca"
Output: 1
Explanation:
If we insert the character ‘b’ after ‘c’, we get the string "abcba", which is a palindromic string. Please note that there are also other ways possible.
You must sell the stock before you buy it again.
The optimal solution was to use Valley Peak Approach. In this approach, we need to find the next greater element and subtract it from the current element so that the difference keeps increasing until we reach a minimum. If the sequence is a decreasing sequence, so the maximum profit possible is 0.
This round was conducted in the evening by a Senior Hiring Manager. The interviewer was very friendly. The questions asked in this round were situation based and were testing if I was aware of the company culture and values.
There are 20 lions who are hungry and there's a piece of meat. Every time a lion eats that piece of meat, it goes to sleep and is eaten by another lion. In this way, only a single lion will be left. I had to tell what can be done so that maximum lions can live.
Tip 1 : Cut the meat into 20 pieces.
Tip 2 : Tell every possible answer you can think of.
You are an outstanding performer. You have done a mistake and your promotion is due. Your manager asked you not to tell the seniors about the mistake until the promotion. After you'll get promoted, you can tell then. What will you do?
Tip 1 : Yes, tell the seniors about the mistake at the earliest.
Tip 2 : Morgan Stanley's value includes honesty so everyone in the organization should know what is going on.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Suppose list1 is [2, 133, 12, 12], what is max(list1) in Python?