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:
Multi-threading Java Interview Questions for Investment Bank
Upasana | July 25, 2020 | 4 min read | 751 views
-
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.
-
What are the drawbacks of not synchronizing the getters of an shared mutable object?
-
Can Keys in HashMap be made Mutable? What would be the impact in that case?
-
How would you implement your own ThreadPool in Java? Discuss the designing part.
-
How would you implement a Stack or a Queue in Java? It must be synchronized.
-
Implement Queue using an ArrayList.
-
What are the types of Inner classes with example of each?
-
What is a tree map? Discuss its underlying implementation i.e. red-black binary tree.
-
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.
-
What is difference between StringBuilder and String? Which one should be preferred.
-
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
-
What are memory generations in Hot Spot VM? How generational GC’s work?
-
What is difference between Primary Key and Unique Key?
-
What is clustered and non-clustered index in Sybase database?
-
What is Outer and Inner Join?
-
What is ADT? We do not need to know how a data type is implemented in order to be able to use it.
-
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?
-
How would you make an application asynchronous? Can Message Queues help achieving this?
-
How to achieve loose coupling in your application?
-
What is TDD and how it helps Agile methodology of software development?
-
What is best way to store Currency Values in Java application?
-
What is AtomicInteger and how it is useful in concurrent environment?
Design Interview Questions
-
What are key principles while designing Scalable Software Applications?
-
What does Collections.unmodifiableCollection() do? is it useful in multi-threading environment?
-
How would you add an element to a Collection while iterating over it in a loop?
-
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?
-
How would you write a simple Interceptor in Struts 2 which can log the request and response to an Action?
-
What are database transaction isolation levels? What is the default value for transaction isolation level.
-
How does Session Handling works in Servlet Environment?
-
What is difference between Http’s redirect and forward request?
-
Iterator Interface provides a remove() method but no add() method, Why?
-
Can you give a try writing a rough Implementation for BlockingQueue in Java?
-
What are Common Threading Issues in Java?
Algorithms and Datastructures
-
How would you resolve Task Inter dependency pragmatically as is done in Ant?
-
How would you sort 900 MB of data using 100 MB of RAM?
-
What do you understand by GC tuning, What are GC pauses (stop the world)? How would you tune a given Java Program?
-
What is a PriorityQueue? How is it implemented in Java? What are its usages?
-
Your are give a file with millions of numbers in it. Find the 20 biggest numbers?
-
What is difference between synchronized HashMap and a hashtable?
-
What do you understand by Token Bucket Algorithm. What are its applications?
-
What are the key principles when designing a software for performance efficiency?
-
Design Phone Book for a mobile using TRIE (or a prefix tree)
-
Design a Pricing Service that lists top 10 stocks of the day.
-
Is it possible to make an array volatile in Java to write thread-safe code?
Top articles in this category:
- Citibank Java developer interview questions
- RBS Java Programming Interview Questions
- UBS Java Interview Questions
- Morgan Stanley Java Interview Questions
- Cracking core java interviews - question bank
- BlackRock Java Interview Questions
- Sapient Global Market Java Interview Questions and Coding Exercise