Questions that most Java candidates answer wrongly
Carvia Tech | December 16, 2017 | 1 min read | 133 views
There are few questions for which I rarely find right answer from the interview Candidates, here is the list ..
Is it required to synchronize the accessor of a shared mutable object in case of multi-threading? And why?
In which scenario StringBuilder should be preferred over String class?
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.
How Atomic updates are different from their synchronized counterpart?
When do we get the ConcurrentModificationException? What constitutes the structural modifications in a collection?
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?
What is difference between Class and the Instance level locking?
Can you prove a scenario where thread starvation occurs?
Is it a mandate to make all fields final inside a immutable class? If yes, why?
How to fix Double Check Locking (DCL multi-threading singleton problem)?
What is Java Memory Model ? Who should read it?
What is upper bound and lower bound in generics?
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:
- Java Concurrency Interview Questions and Answers
- Morgan Stanley Investment Banking Java Interview Questions
- Sapient Global Market Java Interview Questions and Coding Exercise
- Goldman Sachs Java Interview Questions for Senior Developer
- Citibank Java developer interview questions
- UBS Top 10 Java Interview Questions
- ION Trading Java Interview Questions
Find more on this topic:
Interview - Product Companies, eCommerce Companies, Investment Banking, Healthcare Industry, Service Companies and Startups.
Last updated 1 week ago
Recommended books for interview preparation:
- Spring Boot with GMAIL SMTP
- Mandrill emails in Spring Boot Java
- Top 30 Hibernate and Spring Data JPA interview questions
- Generating variable length secure key/secret in Java
- Reverse the bits of a number and check if the number is palindrome or not
- MD5 and SHA256 in Java Kotlin and Android
- Spring Security 5 - There is no PasswordEncoder mapped for the id
- Inter-thread communication in Java
- What are different thread states in Java
- Static method synchronization aka Class Lock in Java