How to prepare for Java interview


Java is the best and top notch programming language which is used in many ways and many other programming languages are completely dependent on it.Java is the key thing to create many web applications and other desktop applications too but mainly it is focussed on creation of web apps.Java is divided into two parts mainly they are 1)Core Java 2)Advanced Java.

In core Java all the basic concepts of java are covered and in Advanced java you will be introduced to Servlets,JDBC connection etc.So,they are many best books which you should follow and learn in order to improve your Java Knowledge.They are many tips you should follow carefully before going to a java interview.For clearing the java interview you should be good in all the java basic topics and must be strong in core java is the foundation for the java programming language you should be well profound with all the topics in it.

Best Books

They are many best java book you should refer to before going for an interview such as

  • JAVA: A Beginner to Expert Guide to Learning the Basics of Java Programming
  • Head First Java, 2nd Edition
  • Java: The Complete Reference, Ninth Edition
  • Thinking in Java (4th Edition)
  • Java: An Introduction to Problem Solving and Programming (7th Edition)
  • Data Structures and Algorithms Made Easy in Java by Narasimha Karumanchi

Basic Topics

And they are also some basic topics which you need to refer such a JRE, JDK & JVM,OOPS,Different scenarios related to oops like scenarios based on compile-time and runtime polymorphism, different type of inheritance,exception hierarchy, checked and unchecked exception, Different scenarios related to exceptions,Threads , their states and ways of creating threads,Collection framework and difference between different collections,Generics,Hashcode and equals and their contract.

Question and Answers

They are some excellent questions which you need to refer before going to an interview.Here they are

  • Difference between extends Thread and implements Runnable in Java
  • Difference between PATH and Classpath in Java?
  • What is load factor of HashMap means?
  • Difference between notify and notifyAll in Java?
  • Difference between wait and sleep in Java?
  • Which two methods you will override for an Object to be used as Key in HashMap?
  • Difference between Hashtable and ConcurrentHashMap in Java?
  • Difference between ArrayList and Vector in Java?
  • Difference between List and Set in Java?
  • Difference between Hashtable and HashMap in Java?
  • Can we override private method in Java?
  • Difference between Serializable and Externalizable in Java?
  • Difference between transient and volatile variable in Java?
  • When to use transient variable in Java?
  • When to use volatile variable in Java?
  • How do you create thread-safe Singleton in Java?
  • What is double checked locking in Singleton?
  • Difference between ArrayList and HashSet in Java?
  • Write a Java program to check if a number is Even or Odd?
  • What is ClassLoader in Java?
  • How Java achieves platform independence?
  • What is difference between StringBuffer and StringBuilder in Java ?
  • What is the difference between factory and abstract factory pattern?
  • What do you understand by thread-safety ? Why is it required ? And finally, how to achieve thread-safety in Java Applications ?
  • What will happen if you call return statement or System.exit on try or catch block ? will finally block execute?
  • How do you ensure that N thread can access N resources without deadlock
  • Can you access non static variable in static context?

The topics ,books and questions above mentioned are hugely important and you should concentrate on above topics to set your interview in the correct way.