Code Pumpkin

Morgan Stanley Interview Questions – Set 1

August 26, 2017
Posted by Rahul Jain

Recently I have appeared for Java developer interview at the Morgan Stanley, Mumbai. It was a Video conference interview. Here are the set of questions asked to me :  

  1. Tell me about your current project and your roles and responsibility.
  2. Write a java function to reverse a string using recursion
  3. Write a java program to represent LRU Cache.
  4. Write a java program to find unique element from array of duplicates. For Example, 

Input Array : 1 2 1 1 2 3 4 2 4 5 2 4 5
Output         : 3
Assume that array size is too large or infinite. You need to write an optimal solution.

Answer : If you are allowed to use external datastrucure, you can use HashMap Approach.

  1. How I will get to know that whether my child thread has completed execution or it has thrown an exception?
  2. Do you know any way to return a value from your child thread to main thread?
  3. What's the difference between Future and FutureTask in Java?
  4. Suppose I have furniture shop. 
  • In furniture shop, there are objects like table, chair, doors
  • Each objects can be made up of material like wood, glass, plastic
  • Each object can have different weight based on the material being used

      Which all classes you will use to represent above furniture shop and design a class diagram for the same.
   

  1. How Garbage collector works? Tell me about different memory areas in JVM.
  2. You are given a large number of files which contains comma separated data as 'personName,skill' as shown  below

File 1:
abc,java
xyz,database


File 2: 
Meet,XML
Rahul,HTML

File 3:
abc,oracle
Meet,XML

I want to write a program which will give me following output:

abc:java,oracle
xyz:database
Meet:XML
Rahul:HTML

Also mention which datastructure you will use and why?

  1. Why Concurrent HashMap is a good choice for many read operation and less write operations?
  2. Why do you want to join Morgan Stanley?
  3. Why do you want to relocate to Mumbai?

  


This article is contributed by Rahul Jain. If you would also like to contribute your article or share interview experiences, you can create contributor account with codePumpkin by clicking here.
 

That's all for this topic. If you guys have any suggestions or queries, feel free to drop a comment. We would be happy to add that in our post. You can also contribute your articles by creating contributor account here.

Happy Learning 🙂

If you like the content on CodePumpkin and if you wish to do something for the community and the planet Earth, you can donate to our campaign for planting more trees at CodePumpkin Cauvery Calling Campaign.

We may not get time to plant a tree, but we can definitely donate ₹42 per Tree.



About the Author





Tags: , , , , , , , ,


Comments and Queries

If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
<pre><code class="java"> 
String foo = "bar";
</code></pre>
For more information on supported HTML tags in disqus comment, click here.
Total Posts : 124
follow us in feedly

Like Us On Facebook