Saturday, April 6, 2013

Top 50 Java Interview Questions for Investment Banking Domain & HealthCare IT


1. What do you understand by thread-safety ? Why is it required ? And finally, how to achieve thread-safety in Java Applications ?

Hint : discuss the need for the concurrent programming, using volatile, synchronization, Immutability & Atomic packages to address the concurrency problems. Discuss the Java Memory Model. Impact of final keyword in Java. Differences between wait and notify method in Object class.
http://crackingjavainterviews.blogspot.in/2013/04/what-do-you-understand-by-java-memory.html

2. What are the drawbacks of not synchronizing the getters of an shared mutable object ?

http://crackingjavainterviews.blogspot.in/2013/04/what-if-we-dont-synchronize.html

3. Discuss the Singleton Design Pattern ? How to make it thread-safe ? Discuss the Double Check Locking (DCL) ?

http://crackingjavainterviews.blogspot.in/2013/05/what-is-double-checked-locking-problem.html

4. Can Keys in HashMap be made Mutable ? What would be the impact in that case ?

http://crackingjavainterviews.blogspot.in/2013/04/can-keys-in-hashing-data-structure-be.html

5. How would you implement your own ThreadPool in Java ? Discuss the designing part.


6. How would you implement a Stack or a Queue in Java ? It must be synchronized.


7. Discuss Big O notation for calculating relative performance of Algorithms. How do various collection methods perform in terms of Big O Notation ?

http://crackingjavainterviews.blogspot.in/2013/05/what-do-you-understand-by-big-o.html

8. Implement Queue using an ArrayList.


9. What are the types of Inner classes with example of each ?


10. What is a tree map ? Discuss its underlying implementation i.e. red-black binary tree.


11. There are 1 million trades, you need to check if a given trade exists in those trades or not. Which Collection would you chose to store those 1 million trades and why ?

Hint : think from time complexity point of view and why HashSet could be a better data structure for storing these trades assuming we have sufficient memory to hold those items.

12. What is difference between StringBuilder and String ? Which one should be preferred.


13. In a program, multiple threads are creating thousands of large temporary StringBuilder objects. Life span of all those objects is 1 GC cycle. But somehow we are getting JVM pauses in our application. How would you troubleshoot the problem ?

Hint : Think from GC tuning perspective

14. What are memory generations in Hot Spot VM? How generational GC's work?


15. What is difference between Primary Key and Unique Key?


16. What is clustered and non-clustered index in Sybase database?


17. What is Outer and Inner Join?


18. What is ADT ? We do not need to know how a data type is implemented in order to be able to use it.


19. Are you familiar with a messaging system i.e. MQ ? What is a QueueManager ? Why do you think the Queue is so important in banking world ?


20. How would you make an application asynchronous ? Can Message Queues help achieving this ?


21. How to achieve loose coupling in your application ?


22. What is TDD and how it helps Agile methodology of software development ?


23. How to make a class Immutable ? What purpose Immutablity solve ?

http://crackingjavainterviews.blogspot.in/2013/05/what-is-immutable-class-why-would-you.html

24. What is difference between Callable and Runnable ?

http://crackingjavainterviews.blogspot.in/2013/05/what-is-difference-between-callable-and.html

25. What are Inheritance strategies in JPA ?

http://crackingjavainterviews.blogspot.in/2013/05/what-are-inheritance-stretegies-in-jpa.html

26. Discuss Internals of HashMap and ConcurrentHashMap ?

http://crackingjavainterviews.blogspot.in/2013/04/discuss-internals-of-concurrent-hashmap.html

27. What is best way to store Currency Values in Java application ?

http://crackingjavainterviews.blogspot.in/2013/04/best-way-for-storing-currency-values-in.html

28. What is AtomicInteger and how it is useful  in concurrent environment ?
http://crackingjavainterviews.blogspot.in/2013/04/what-is-atomicinteger-class-and-how-its.html


29. What are key principles while designing Scalable Software Applications ?
http://crackingjavainterviews.blogspot.in/2013/04/what-are-key-principles-when-designing.html

30. What does Collections.unmodifiableCollection() do ? is it useful in multi-threading environment ?

http://crackingjavainterviews.blogspot.in/2013/05/what-does-collectionsunmodifiablecollec.html

31. How would you add an element to a Collection while iterating over it in a loop ?
http://crackingjavainterviews.blogspot.in/2013/06/removing-elements-while-iterating-over.html

32. There are 3 Classes A, B and C. C extends B and B extends A, each class has a method named add() with same signature (overriding). Is it possible to call A's add() method from Class C ? Reason ?

33. How would you write a simple Interceptor in Struts 2 which can log the request and response to an Action ?


34. What are database transaction isolation levels ? What is the default value for transaction isolation level.


35. How does Session Handling works in Servlet Environment?


36. What is difference between Http's redirect and forward request ?


37. Iterator Interface provides a remove() method but no add() method, Why ?


38. Can you give a try writing a rough Implementation for BlockingQueue in Java ?


39. What are Common Threading Issues in Java ?


40. Given a Collection of 1 million integers ranging between 1 and 9, Can you sort them all in Big O(n) time ?

http://crackingjavainterviews.blogspot.in/2013/06/given-collection-of-1-million-integers.html

41. How would you resolve Task Inter dependency pragmatically as is done in Ant ?


42. How would you sort 900 MB of data using 100 MB of RAM ?

43. What do you understand by GC tuning, What are GC pauses (stop the world)? How would you tune a given Java Program ?

44. What is a PriorityQueue ? How is it implemented in Java ? What are its usages ?

45. Your are give a file with millions of numbers in it. Find the 20 biggest numbers ?

46. What is difference between synchronized HashMap and a hashtable ?

47. What do you understand by Token Bucket Algorithm. What are its applications ?

48. What are the key principles when designing a software for performance efficiency ?

49. How would you describe Producer Consumer problem in Java?

http://crackingjavainterviews.blogspot.com/2018/07/what-is-producer-consumer-multi.html

50. Design Phone Book for a mobile using TRIE (or a prefix tree)



51. How would you count word occurrence in a very large file ? How to keep track of top 10 occurring words?
http://crackingjavainterviews.blogspot.in/2015/02/how-would-you-count-word-occurrence-in.html
52. What happens when you type a url in browser's address bar ?


For more such questions, you can get my ebook

Cracking Core Java Interviews
Buy from Shunya @ 250 ₹ (DRM Free)
Buy from Pothi.com

1 comment:

Your comment will be published after review from moderator