sample questions for domain interview (technical)

1
1. The pros and cons of using Thread vs Runnable. 2. write the code for typical Producer Consumer scenario 3. provide a scenario where one would prefer notify() or notifyAll() above other. 4. for Singleton, provide a thread safe implementation. 5. difference b/w Interfaces and Abstract classes or using Threads vs Runnable. 6. how to create a thread by extending Thread class. 7. tell a practical scenario where we require Synchronization. (Any scenario when two or more threads are corrupting a shared resource). 8. write a LinkedList implementation of his own. 9. how to make a class Immutable in Java. 10. write a method to swap two numbers-This is a just a way to ask call by value vs call by reference practically 11. Pros and cons of extending Thread vs Implementing Runnable 12. Difference b/w 'wait' and 'sleep'. 13. How a Thread reaches 'wait' state. 14. In Serialization how to handle a simple Client Server scenario where a change in a class on Client side has not been reflected on server side. Serial Version UId. 15. Marker Interfaces (justification of having Marker Interfaces in the first place). 16. In Data Structures-define Hashing. In Collections, define HashMap

Upload: sreenivasulureddych

Post on 25-Nov-2015

4 views

Category:

Documents


0 download

TRANSCRIPT

1

1. The pros and cons of using Thread vs Runnable.2. write the code for typical Producer Consumer scenario

3. provide a scenario where one would prefer notify() or notifyAll() above other.4. for Singleton, provide a thread safe implementation.5. difference b/w Interfaces and Abstract classesorusing Threads vs Runnable.6. how to create a thread by extendingThread class.7. tell a practical scenario where we require Synchronization. (Any scenario when two or more threads are corrupting a shared resource).8. write a LinkedList implementation of his own.9. how to make a class Immutable in Java.10. write a method to swap two numbers-Thisis a just a way to ask call by value vs call by reference practically 11. Pros and cons of extending Thread vs Implementing Runnable 12. Difference b/w 'wait' and 'sleep'. 13. How a Thread reaches 'wait' state.

14. In Serialization how to handle a simple Client Server scenario where a change in a class on Client side has not been reflected on server side. Serial Version UId. 15. Marker Interfaces (justification of having Marker Interfaces in the first place). 16. In Data Structures-define Hashing. In Collections, define HashMap