CodeGym /Java Blog /Random /Top 150 Most Frequently Asked Job Interview Questions for...
Author
Pavlo Plynko
Java Developer at CodeGym

Top 150 Most Frequently Asked Job Interview Questions for Java Devs

Published in the Random group
At CodeGym, we keep saying that learning Java from scratch and getting a job as a software developer is easy. Relatively speaking of course, and if you are leveraging all the beautiful abilities of such a powerful learning platform as CG, with all the gamification elements to make the process fun, social features not to feel alone while doing it, and additional functions to load you with motivation and support discipline. Although providing all the information and support necessary to succeed, we are not trying to sell you a bill of goods. Being a fresh Java programmer with little to no work experience can be hard. Companies are naturally willing to hire people at least with 2-3 years of actual work experience, while Junior developer positions are not very common and often get lots of applications.Top 150 Most Frequently Asked Job Interview Questions for Java Devs - 1

150 most common job interview questions for Java developers

Software developers probably have to go through some of the toughest job interviews among all the professions out there. Just because a programmer has to know a lot, people interviewing them ask lots and lots of questions, which you need to answer in a correct and relevant way. When it comes to a Junior Developer interview, the interviewers normally don’t ask questions that are objectively difficult to answer. Instead they are focusing on questions covering all the basic aspects of Java and it’s fundamentals. Questions for Middle and Senior-level developers tend to get trickier and more detailed. Feel the stress already? Don’t. What you should do is go through each and every question that is commonly asked in interviews for Java developer positions and learn what kind of answers you are expected to give. Here is CodeGym’s list of 150 most popular Java job interview questions divided by the areas of knowledge.

Java Core

  1. What is an object in Java?
  2. What is the difference between С++ and Java?
  3. What is bytecode in Java?
  4. What is the difference between method overloading and method overriding in Java?
  5. What is the difference between abstract class and interface?
  6. Why is Java platform independent?
  7. What is the most important feature of Java?
  8. What do you mean by platform independence?
  9. What is JVM?
  10. Are JVMs platform independent?
  11. What is the difference between a JDK and a JVM?
  12. What is a pointer and does Java support pointers?
  13. What is the base class of all classes?
  14. Does Java support multiple inheritance?
  15. How are Runtime exceptions different from Checked exceptions?
  16. What are the most important features introduced in Java 5, 7 and 8 respectively?
  17. Is Java a pure object oriented language?
  18. Is Java a statically or dynamically typed language?
  19. Do arguments in Java get passed by reference or by value?
  20. What is the difference between an abstract class and an interface and when would you use one over the other?
  21. What is bytecode in Java?
  22. What is the difference between method overloading and method overriding in Java?
  23. What is the difference between abstract class and interface?
  24. What is the difference between this() and super() in Java?
  25. What is Unicode?

Java Threads

  1. What is thread in Java?
  2. What is the difference between process and thread?
  3. What is Multitasking?
  4. What is the difference between process-based and thread-based multitasking?
  5. What is Multithreading, and what are its application areas?
  6. What is the advantage of Multithreading?
  7. List Java APIs that support threads.
  8. In how many ways we can create threads in Java?
  9. Explain creating threads by implementing Runnable class.
  10. Explain creating threads by extending Thread class.
  11. What is the best approach for creating thread?
  12. Explain the importance of thread scheduler in Java.
  13. Explain the life cycle of thread.
  14. Can we restart a dead thread in Java?
  15. Can one thread block the other thread?
  16. Can we restart a thread already started in Java?
  17. What is a lock or purpose of locks in Java?
  18. In how many ways we can do synchronization in Java?
  19. What are synchronized methods?
  20. When do we use synchronized methods in Java?
  21. What are synchronized blocks in Java?
  22. When do we use synchronized blocks and what are the advantages of using synchronized blocks?
  23. What is class level lock?
  24. Can we synchronize static methods in Java?
  25. Can we use synchronized block for primitives?

OOPs in Java

  1. Explain object oriented programming and its features.
  2. What is Abstraction?
  3. What is Encapsulation?
  4. What is the difference between abstraction and encapsulation?
  5. List out benefits of object oriented programming language.
  6. What are the differences between traditional programming language and object oriented programming language?
  7. What is Inheritance?
  8. What is Polymorphism?
  9. How does Java implement polymorphism?
  10. Explain the different forms of Polymorphism.
  11. What is runtime polymorphism or dynamic method dispatch?
  12. What is Dynamic Binding?
  13. What is method overloading?
  14. What is method overriding?
  15. What are the differences between method overloading and method overriding?
  16. Is it possible to override the main method?
  17. How to invoke a superclass version of an Overridden method?
  18. How do you prevent a method from being overridden?
  19. What is an Interface?
  20. Can we create an object for an interface?
  21. Do interfaces have member variables?
  22. What modifiers are allowed for methods in an Interface?
  23. What is a marker interface?
  24. What is an abstract class?
  25. Can we instantiate an abstract class?

Exceptions in Java

  1. What is an Exception in Java?
  2. What is the purpose of Exception Handling?
  3. What is the meaning of Exception Handling?
  4. Explain Default Exception Handling Mechanism in Java.
  5. What is the purpose of ‘try’?
  6. What is the purpose of catch block?
  7. What are various methods to print Exception information? and differentiate them.
  8. Is it possible to take try-catch inside try block?
  9. Is it possible to take try-catch inside catch block?
  10. Is it possible to take try without catch?
  11. What is the purpose of finally block?
  12. Will finally block be executed always?
  13. In which situation finally block will not be executed?
  14. What is the difference between final, finally and finalize()?
  15. Is it possible to write any statement between try-catch and finally?
  16. Is it possible to take two finally blocks for the same try?
  17. What is the purpose of throw?
  18. Is it possible to throw an Error?
  19. Is it possible to throw any Java object?
  20. What is the difference between throw and throws?
  21. What is the difference between throw and thrown?
  22. Is it possible to use throws keyword for any Java class?
  23. What is the difference between Error and Exception?
  24. What is the difference between checked exception and unchecked exception?
  25. What is difference between partially checked and fully checked Exception?

Collections in Java

  1. What are the limitations of object arrays?
  2. What are the differences between arrays and collections?
  3. What are the differences between arrays and ArrayList?
  4. What are the differences between arrays and Vector?
  5. What is Collection API?
  6. What is Collection framework?
  7. What is the difference between Collections and Collection?
  8. Explain about Collection interface.
  9. Explain about List interface.
  10. Explain about Set interface.
  11. Explain about SortedSet interface.
  12. Explain about Vector class.
  13. What is the difference between ArrayList and Vector?
  14. How can we get a synchronized version of ArrayList?
  15. What is the difference between size and capacity of a Collection Object?
  16. What is the difference between ArrayList and Linked List?
  17. What are legacy classes and interfaces present in Collections framework?
  18. What is the difference Enumeration and Iterator?
  19. What are limitations of Enumeration?
  20. What is the difference between enum and Enumeration?
  21. What is the difference between Iterator and ListIterator?
  22. What is Comparable interface?
  23. What is Comparator interface?
  24. What are the differences between Comparable and Comparator?
  25. What is the difference between HashSet and TreeSet?

Hibernate

  1. What is Hibernate?
  2. What is ORM?
  3. What are the ORM levels?
  4. Why do you need ORM tools like Hibernate?
  5. What is the main difference between Entity Beans and Hibernate?
  6. What are the Core interfaces and classes of Hibernate framework?
  7. What is the general flow of Hibernate communication with RDBMS?
  8. What are the important tags of hibernate.cfg.xml?
  9. What role does the Session interface play in Hibernate?
  10. What role does the SessionFactory interface play in Hibernate?
  11. What are the most common ways to specify the Hibernate configuration properties?
  12. How do you map Java Objects with Database tables?
  13. How do you define sequence generated primary key algorithm in Hibernate?
  14. What is component mapping in Hibernate?
  15. What are the types of Hibernate instance states?
  16. What are the types of inheritance models in Hibernate?
  17. What is Named SQL Query?
  18. What are the benefits of Named SQL Query?
  19. How do you switch between relational databases without code changes?
  20. How to see the Hibernate generated SQL statements on console?
  21. What are derived properties?
  22. Define cascade and inverse option in one-many mapping.
  23. What is a transaction file?
  24. What do you mean by Named ñ SQL query?
  25. How do you invoke Stored Procedures?

Best Java Developer job interview prep platforms

Another way to prepare yourself for a coding job interview (instead of simply learning the answers to every question in the list one by one) is using programming interview preparation platforms. Here are some of the best and most popular ones. One of the most popular tech interview platforms with a huge community and over 1650 questions for you to practice. Supports 14 programming languages including Java. Another well-known website with all kinds of content for programming job interviews preparation, including articles, tips, and lots of interview questions. Nice platform with lots of interesting features, including the selection of 100 hand-picked questions that would be most relevant for your targeted position. Supports 9 programming languages including Java. This platform has an original approach to coding interviews preparation. Instead of just providing you with questions and answers, it has hours of videos of real job interviews for you to watch. It also allows you to book real mock interviews conducted by interviewers that come from Google, Facebook, Airbnb, Dropbox, AWS, Microsoft, etc. One more great platform to test yourself in live mock interviews, as well as participating in coding competitions and hackathons.

More Java job interview questions

And if you feel like our list of 150 Java job interview questions was not large enough for you, here are a few other great CodeGym articles with questions, answers and tips to succeed in the interview and get the job.
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION