Domanda di colloquio di Morgan Stanley

1. Write a function to reverse a string. 2. What’s the difference between Interface and Abstract. 3. Write a function to reverse words in a string ex: “how are you” becomes “you are how”. 4. Can you assign a String to and Object? What about the other way around and why? 5. Explain Generics. 6. Explain Generics wildcards. 7. Find the depth of a binary tree. 8. How can you run one thread and then another only after the first thread has completed? 9. What’s the difference between a thread sleep() and wait()? What about suspend(), resume()? 10. Write a function that traverses an array and checks the sum to the left of the index with the sum to the write of the index, and returns the index position when the left summation equals the right. Can you optimize your solution further? 11. Write an iterator that traverses an array of integers, but only for even values. 12. Design a library containing books with users that can check out books from the library. This task is to meant to demonstrate your design abilities.