Morgan Stanley Java Interview Questions

Upasana | July 24, 2020 | 3 min read | 2,626 views | investment banking


Database

  • What are type of indexes in Sybase Database? What is difference between these different types?

  • What is a stored procedure. How will you performance tune a query in sybase database?

  • What is difference between Left Outer Join and Right Outer Join?

  • How will you find nth highest salary of an employee from Salary table?

  • What is database normalization?

  • How will you express ManyToMany relationship in database? Give any practical usecase for ManyToMany relationship.

  • How does Lazy loading works in Hibernate? How will load a lazily loaded item in hibernate to avoid LazyLoadingException?

  • How will you handle concurrent updates to a shared row in database? Let’s say bank account table, where two or more requests are coming in parallel?

Java (Core, Design Patterns, Concurrency, Algorithms and Data Structure)

  • What is polymorphism? When does a method override in Java?

  • What are Immutable Objects? What are their advantages? Design an Immutable Class that has a java.util.Date member? (consider that Date itself is mutable)

  • What all Design Patterns you are aware of? What is Singleton Design Pattern? How will you make singleton thread-safe?

  • Given a String find the first non-repeatable character in the String. Example: str="zzzzzbbbccccddehhhhiii"; Answer is: e

  • What is time complexity of HashMap insertion and retrieval in Java?

  • Discuss internals of a Hashmap’s get and put method. What is role of hashcode and equals method in get and put operation?

  • Data (volume, price etc.) for various stocks in coming up in the Exchange, how will you design a thread-safe class that maintains the total volume traded in the exchange at any given point in time? It should be very high throughput design.

  • How to sort data that can’t fit into main memory?

  • How to sort 1 million numbers (all positive integers), considering that only 0.1 million numbers can be accommodated into main memory?

  • How Garbage Collection Works in Java? Name few garbage collection algorithms?

  • What is use of StringBuilder class?

  • What is difference between sleep() and wait()?

  • How will you reverse a singly linked list in Java?

  • How will you create an artificial OutOfMemory Error in java?

  • What is difference between Synchronized Map and ConcurrentHashMap?

  • Explain the proper use of hashcode() and equals() method.

  • What is Queue? How will you implement a Queue using a ArrayList?

  • There is a file containing large numbers, you need to print numbers and their corresponding count in the file for 2 scenarios - 1) No memory constraints 2) limited memory available and not the entire data can fit into main memory.

  • Given a dictionary, find all the words that are anagram to each other?

  • Remove duplicate numbers from a sorted Array?

  • How will you increment each element of a huge array using all the available cpu cores of machine?

Unix and Operating Systems

  • How to find and kill a process in Unix?

  • How will you figure out free available space in Unix?

  • How will you find files recursively that contains specific words in their filename?

  • How will you find files recursively that contains specific words in their contents?

  • How to sort a file using unix command?

  • How to count number of lines in a file in unix terminal?

  • What is piping of commands in unix? any example?

  • How will you list nth column of a flat file in Unix?

  • How will you find a process using specific port in Unix and Windows?

  • How password less authentication works in Unix?

  • How will you copy a file from one Unix host to another Unix host?

Aptitude & Puzzles

  • You are given 2 eggs. You have access to a 100-storey building. Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100 th floor.Both eggs are identical. You need to figure out the highest floor of a 100-storey building an egg can be dropped without breaking. Now the question is how many drops you need to make. You are allowed to break 2 eggs in the process.


Buy my ebook for complete question bank

Most of these questions has been answered in my eBook "Cracking the Core Java Interview" updated on June 2018, that you can buy from this link:

Buy from Shunya (DRM Free PDF download with updates)

investment banking:
  1. Finastra Investment Banking Interview Questions
  2. Markit Java Interview Questions
  3. Goldman Sachs Java Interview Questions
  4. Java topics covered in Investment Banking Interviews (Morgan Stanley, Barclays, RBS, UBS, BlackRock)
  5. UBS Java Interview Questions
  6. ION Trading Java Interview Questions
  7. Citibank Java developer interview questions
See all articles in investment banking
Top articles in this category:
  1. Multi-threading Java Interview Questions for Investment Bank
  2. Sapient Global Market Java Interview Questions and Coding Exercise
  3. Citibank Java developer interview questions
  4. UBS Java Interview Questions
  5. Goldman Sachs Java Interview Questions
  6. ION Trading Java Interview Questions
  7. BlackRock Java Interview Questions

Recommended books for interview preparation:

Find more on this topic: