Morgan Stanley Interview Questions – Set 1
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 :
- Tell me about your current project and your roles and responsibility.
- Write a java function to reverse a string using recursion
- Write a java program to represent LRU Cache.
- 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.
- How I will get to know that whether my child thread has completed execution or it has thrown an exception?
- Do you know any way to return a value from your child thread to main thread?
What's the difference between
- 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.
- How Garbage collector works? Tell me about different memory areas in JVM.
- You are given a large number of files which contains comma separated data as 'personName,skill' as shown below
I want to write a program which will give me following output:
Also mention which datastructure you will use and why?
- Why Concurrent HashMap is a good choice for many read operation and less write operations?
- Why do you want to join Morgan Stanley?
- Why do you want to relocate to Mumbai?
Comments and QueriesIf 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.