Wissen Infotech Interview Questions – Set 1
I have appeared for Java Developer requirement at Wissen Infotech, Bangalore Location. Requirement was for their client Morgan Stanley and it was my second technical round. It was a telephonic interview. Duration : 1 hour
Core Java
-
What is the difference between
CountDownLatch
andCyclicBarrier
. (Answer) -
What is the time complexity of
put()
andget()
operation inHashMap
? (Answer) - Why do we need thredpool in Java Application? (Answer)
-
What is the time complexity of
put()
andget()
operations inConcurrentHashMap
? -
How
ConcurrentHashMap
works internally? -
If Concurrency level of
ConcurrentHashMap
is 4, can more than four thread read simultaneously fromConcurrentHashMap
?
Answer : Yes. Any number of threads can read concurrently fromConcurrentHashMap
. -
If one thread is writing in one segment of
ConcurrentHashMap
, Can other thread read from that segment?
Answer : Yes. In that case, reading thread will read last updated value as value field is volatile inConcurrentHashMap
entry object. -
What is the difference between synchronized keyword and
ReentrantLock
? Advantages ofReentrantLock
over synchronized keyword.
SQL
- What is the difference between clustered and non-clustered index?
Problem Solving
- Print 1 to 20 numbers using two different threads concurrently.
Thread 1 prints 1, 3, 5, 7,…,19
Thread 2 prints 2, 4, 6, 8,…,20
- Find the intersection of two singly linked list?
For Example,
First LinkedList : 1 -> 2 -> 3 -> 4 -> 5
Second LinkedList : 10 -> 9 -> 8 -> 7 -> 4 -> 5
Answer should be 4 i.e. both the lists are same after 4.
- I am having website which displays best three prices of the same product from different eCommerce sites.
For Example,
Price of Samsung Galaxy S8 is
64000/- INR on Flipkart
60000/- INR on Amazon
66000/- INR on eBay
63000/- INR on bestBuy
67000/- INR on Infibeam
Our site should display Amazon, bestBuy and Flipkart prices for Samsung Galaxy S8.
Each e-commerce website sends frequent request for any update in price.
For processing such request we are having below method signature.
We need to implement this method such a way that we will ignore such request, if we have already received request in last one hour for the same product from the same e-Commerce site. We need to handle multiple requests concurrently.
Explain the logic or the flow of your method?
Which data structure you will use and why?
This article is contributed by Rahul Jain. If you would also like to contribute your article or share interview experiences, you can create contributor account with codePumpkin by clicking here.
That's all for this topic. If you guys have any suggestions or queries, feel free to drop a comment. We would be happy to add that in our post. You can also contribute your articles by creating contributor account here.
Happy Learning 🙂
If you like the content on CodePumpkin and if you wish to do something for the community and the planet Earth, you can donate to our campaign for planting more trees at CodePumpkin Cauvery Calling Campaign.
We may not get time to plant a tree, but we can definitely donate ₹42 per Tree.
About the Author
Tags: Collection Framework, Concurrency, Core Java, Java, Multithreading, Synchronization, Thread
Comments and Queries
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:<pre><code class="java"> String foo = "bar"; </code></pre>For more information on supported HTML tags in disqus comment, click here.