Questions that most Java candidates answer wrongly

Carvia Tech | December 16, 2017 | 1 min read | 51 views


There are few questions for which I rarely find right answer from the interview Candidates, here is the list ..

  1. Is it required to synchronize the accessor of a shared mutable object in case of multi-threading? And why?

  2. In which scenario StringBuilder should be preferred over String class?

  3. I am working on an application where millions of temporary StringBuilder objects are being created, due to which app is facing large GC pauses, how would you rectify the problem, assuming that memory available can not be increased to great extent.

  4. How Atomic updates are different from their synchronized counterpart?

  5. When do we get the ConcurrentModificationException? What constitutes the structural modifications in a collection?

  6. Is it possible to write a method in Java which can swap two int variable? What if we change the type from int to Integer?

  7. What is difference between Class and the Instance level locking?

  8. Can you prove a scenario where thread starvation occurs?

  9. Is it a mandate to make all fields final inside a immutable class? If yes, why?

  10. How to fix Double Check Locking (DCL multi-threading singleton problem)?

  11. What is Java Memory Model ? Who should read it?

  12. What is upper bound and lower bound in generics?

  13. What happens when an exception is thrown from a try block which has no catch clause. But in finally block, a value is returned by the method? Discuss the scenario.


Top articles in this category:
  1. Java Concurrency Interview Questions and Answers
  2. Morgan Stanley Investment Banking Java Interview Questions
  3. Sapient Global Market Java Interview Questions and Coding Exercise
  4. Goldman Sachs Java Interview Questions for Senior Developer
  5. Citibank Java developer interview questions
  6. UBS Top 10 Java Interview Questions
  7. ION Trading Java Interview Questions


Find more on this topic:
Java Interviews image
Java Interviews

Interview - Product Companies, eCommerce Companies, Investment Banking, Healthcare Industry, Service Companies and Startups.

Last updated 1 week ago


Recommended books for interview preparation:

This website uses cookies to ensure you get the best experience on our website. more info