50+ Core Java Interview Questions with Answers for Programmers
Tags: java, programming, career
Published: 2019-08-06 13:49:54

---
title: 50+ Core Java Interview Questions with Answers for Programmers
published: true
description: Frequently asked Core Java Interview questions with answer for beginners and junior developers to land their first Java development job.
tags: java,programming,career
cover_image: https://thepracticaldev.s3.amazonaws.com/i/k63545lbbjmh582tiosr.png
---
*Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided in this article.*

Hello, Java programmers! Over the past few years, I have been sharing a lot of [Java Interview questions](http://javarevisited.blogspot.sg/2015/10/133-java-interview-questions-answers-from-last-5-years.html), answers, and discussion individually. Many of my readers have requested that I bring them together so that they can have them in the same spot for their interview preparation. 

This post is the result of that.

This article contains more than **50 Java Interview questions and answers** covering all important topics like Core Java fundamentals, [Java Collection Framework](https://javarevisited.blogspot.com/2011/11/collection-interview-questions-answers.html), [Java Multithreading and Concurrency](https://javarevisited.blogspot.com/2014/07/top-50-java-multithreading-interview-questions-answers.html), [Java IO](https://javarevisited.blogspot.com/2014/08/socket-programming-networking-interview-questions-answers-Java.html), [JDBC](https://javarevisited.blogspot.com/2012/12/top-10-jdbc-interview-questions-answers.html), [JVM Internals](http://www.java67.com/2016/08/10-jvm-options-for-java-production-application.html), [Coding Problems](http://www.java67.com/2018/06/data-structure-and-algorithm-interview-questions-programmers.html), [Object-Oriented programming](http://www.java67.com/2015/12/top-30-oops-concept-interview-questions-answers-java.html), etc.

These questions are picked up from various Java interviews which I have given and few are shared by my friends, readers, and other people from their own experience. They are, by no means, very difficult. You might have seen them already in your phone or face-to-face round of interviews.

The questions are also very useful to review important Java topics like core Java concepts, multithreading, lambdas, Streams, and collections. 

I have also shared some *useful resources for further learning and improvement* like [**The Complete Java MasterClass**](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fjava-the-complete-java-developer-course%2F) course on Udemy which you can join to brush up and fill gaps in your Java skills.

I have also written books on Java Interview preparation like ["Grokking the Java Interview"](https://gumroad.com/l/QqjGH), and [Grokking the Spring Boot Interviews](https://gumroad.com/l/hrUXKY), where I have shared a lot of questions for Java developers. 

If you are preparing for Java interviews this year you can also get my **[Java + Spring Interview + SQL Bundle on Gumroad](https://javinpaul.gumroad.com/l/sowpfg)**, use code **friends20** to get a 20% discount also

[![Java and Spring Interview books](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xj0hpl0w5lyvdrnwlsoe.png)](https://javinpaul.gumroad.com/l/sowpfg)

So what are we waiting for? Here is the list of some of the most frequently asked Java questions in interviews for both beginner and experienced Java developers.

## Top 50 Java Interview Questions for 2 to 3 years Experienced Programmers
So, without wasting any more of your time, here is my list of some of the frequently asked [Core Java Interview Question](http://www.java67.com/2018/03/top-50-core-java-interview-questions.html)s for beginner programmers. This list focuses on beginners and less experienced devs, like someone with 2 to 3 years of experience in Java.

1) **How does Java achieve platform independence?** ([answer](http://www.java67.com/2012/08/how-java-achieves-platform-independence.html))
hint:  bytecode and Java Virtual Machine
answer - Java achieves platform independence by producing bytecode and then running on Java virtual Machine which convert these bytecode to planform dependent machine code. Since JVM is different for different platform, I mean for Windows you have separate JRE (Which includes JVM) and for Linux you will have separate JRE. Since Java code are not compiled to native machine code instead they compiled to bytecode which makes them platform independent. 

2) **What is** `**ClassLoader**` **in Java?** ([answer](http://javarevisited.blogspot.sg/2012/12/how-classloader-works-in-java.html#axzz59AWpr6cb))
hint: part of JVM that loads bytecodes for classes. You can write your own.
answer: In Java, code is encapsulated inside class because Java is an object oriented programming. Your program is written inside class and in order to execute them JVM loads these classes which contains your code. The JVM component which is responsible for loading classes are called classloaders. They are three main classloaders exists in, the bootstrap classloader, the extension classloader and the application classloader. 

Here is a nice diagram which shows the function of each of these classloader Java:

[![classloaders in Java](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g2brxfmzd67dv2k7rwmv.PNG)](https://javarevisited.blogspot.com/2021/05/java-classloader-interview.html)

 

3) **Write a Java program to check if a number is Even or Odd?** ([answer](http://javarevisited.blogspot.sg/2013/04/how-to-check-if-number-is-even-or-odd.htm))
hint: you can use the bitwise operator, like bitwise AND, remember, even the number has zero at the end in binary format and an odd number has 1 in the end.

4) **Difference between** `**ArrayList**` **and** `**HashSet**` **in Java?** ([answer](http://www.java67.com/2012/07/difference-between-arraylist-hashset-in-java.html))
hint: all differences between `List` and `Set` are applicable here, e.g. ordering, duplicates, random search, etc. See [**Java Fundamentals: Collections**](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fjava-fundamentals-collections) by Richard Warburton to learn more about ArrayList, HashSet and other important Collections in Java.

[![](https://miro.medium.com/max/875/1*hd861fcwDe86tY-1Y0VNRQ.png)](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fjava-fundamentals-collections)

5) **What is double checked locking in Singleton?** ([answer](http://www.java67.com/2016/04/why-double-checked-locking-was-broken-before-java5.html))
hint: two-time check whether instances is initialized or not, first without locking and second with locking.

**6) How do you create thread-safe Singleton in Java? (**[**answer**](http://javarevisited.blogspot.sg/2012/12/how-to-create-thread-safe-singleton-in-java-example.html)**)**
hint: many ways, like using Enum or by using double-checked locking pattern or using a nested static class.

**7) Difference between Serializable and Externalizable in Java? (**[**answer**](http://www.java67.com/2012/10/difference-between-serializable-vs-externalizable-interface.html)**)**
hint: Externalizable gives you more control over the Serialization process.

**8) When to use a transient variable in Java? (**[**answer**](http://www.java67.com/2012/08/what-is-transient-variable-in-java.html)**)**
hint: when you want to make a variable non-serializable in a class, which implements the Serializable interface. In other words, you can use it for a variable whose value you don't want to save. See [**The Complete Java MasterClass**](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fjava-the-complete-java-developer-course%2F) to learn about transient variables in Java.

**9) Difference between the transient and volatile variable in Java? (**[**answer**](http://www.java67.com/2012/11/difference-between-transient-vs-volatile-modifier-variable-java.html)**)**
hint: totally different, one used in the context of serialization while the other is used in concurrency.

**10) When to use the volatile variable in Java? (**[**answer**](http://www.java67.com/2012/08/what-is-volatile-variable-in-java-when.html)**)**
hint: when you need to instruct the JVM that a variable can be modified by multiple threads and give hint to JVM that does not cache its value.


**11) Can we override the private method in Java? (**[**answer**](http://www.java67.com/2013/08/can-we-override-private-method-in-java-inner-class.html)**)**
hint: No, because it's not visible in the subclass, a primary requirement for overriding a method in Java.

**12) Difference between** `**Hashtable**` **and** `**HashMap**` **in Java? (**[**answer**](http://javarevisited.blogspot.sg/2010/10/difference-between-hashmap-and.html#axzz53B6SD769)**)
**hint: several but most important is `Hashtable`, which is synchronized, while `HashMap` is not. It's also legacy and slow as compared to `HashMap`.

**13) Difference between** `**List**`**and** `**Set** `**in Java? (**[**answer**](http://javarevisited.blogspot.sg/2012/04/difference-between-list-and-set-in-java.html#axzz53n9YK0Mb)**)**
hint: `List` is ordered and allows duplicate. `Set` is unordered and doesn't allow duplicate elements.

**14) Difference between** `**ArrayList**` **and** `**Vector**` **in Java (**[**answer**](http://www.java67.com/2012/09/arraylist-vs-vector-in-java-interview.html)**)**
hint: Many, but most important is that `ArrayList` is non-synchronized and fast while `Vector` is synchronized and slow. It's also legacy class like `Hashtable`.

**15) Difference between** `**Hashtable**` **and** `**ConcurrentHashMap**` **in Java? (**[**answer**](http://javarevisited.blogspot.sg/2011/04/difference-between-concurrenthashmap.html#axzz4qw7RoNvw)**)**
hint: more scalable. See [**Java Fundamentals: Collections**](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fjava-fundamentals-collections) by Richard Warburton to learn more.

**16) How does** `**ConcurrentHashMap**` **achieve scalability? (**[**answer**](http://javarevisited.blogspot.sg/2017/08/top-10-java-concurrenthashmap-interview.html#axzz50U9xyqbo)**)**
hint: by dividing the map into segments and only locking during the write operation.

**17) Which two methods you will override for an** `**Object**` **to be used as** `**Key**` **in** `**HashMap**`**? (**[**answer**](http://www.java67.com/2013/06/how-get-method-of-hashmap-or-hashtable-works-internally.html)**)**
hint: equals and hashcode

**18) Difference between wait and sleep in Java? (**[**answer**](http://www.java67.com/2012/08/what-are-difference-between-wait-and.html)**)**\
hint: The `wait()` method releases the lock or monitor, while sleep doesn't.

**19) Difference between** `**notify**` **and** `**notifyAll**` **in Java? (**[**answer**](http://www.java67.com/2013/03/difference-between-wait-vs-notify-vs-notifyAll-java-thread.html)**)**
hint: `notify` notifies one random thread is waiting for that lock while `notifyAll` inform to all threads waiting for a monitor. If you are certain that only one thread is waiting then use `notify`, or else `notifyAll` is better. See [**Threading Essentials Mini-Course**](https://javaspecialists.teachable.com/p/threading-essentials/?product_id=539197&coupon_code=SLACK100?affcode=92815_johrd7r8)by Java Champion Heinz Kabutz to learn more about threading basics.

**20) Why you override hashcode, along with** `**equals()**` **in Java? (**[**answer**](http://javarevisited.blogspot.sg/2015/01/why-override-equals-hashcode-or-tostring-java.html#axzz55oDxm8vv)**)**
hint: to be compliant with equals and hashcode contract, which is required if you are planning to store your object into collection classes, e.g. `HashMap` or `ArrayList`.

**21) What is the load factor of** `**HashMap**` **means? (**[**answer**](http://www.java67.com/2017/08/top-10-java-hashmap-interview-questions.html)**)**
hint: The threshold that triggers the re-sizing of `HashMap` is generally 0.75, which means `HashMap` resize itself if it's 75 percent full.

**22) Difference between** `**ArrayList**` **and** `**LinkedList**` **in Java? (**[**answer**](http://www.java67.com/2012/12/difference-between-arraylist-vs-LinkedList-java.html)**)**
hint: same as an array and linked list, one allows random search while other doesn't. Insertion and deletion easy on the linked list but a search is easy on an array. See [**Java Fundamentals: Collections**](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fjava-fundamentals-collections)**,** Richard Warburton's course on Pluralsight, to learn more about essential Collection data structure in Java.

**23) Difference between** `**CountDownLatch**` **and** `**CyclicBarrier**` **in Java? (**[**answer**](http://www.java67.com/2012/08/difference-between-countdownlatch-and-cyclicbarrier-java.html)**)**
hint: You can reuse `CyclicBarrier` after the barrier is broken but you cannot reuse `CountDownLatch` after the count reaches to zero.

**24) When do you use** `**Runnable**` **vs** `**Thread**` **in Java? (**[**answer**](http://www.java67.com/2016/01/7-differences-between-extends-thread-vs-implements-Runnable-java.html)**)**
hint: always

**25) What is the meaning of Enum being type-safe in Java? (**[**answer**](http://www.java67.com/2014/04/what-java-developer-should-know-about-Enumeration-type-in-Java.html)**)**
hint: It means you cannot assign an instance of different Enum type to an Enum variable. e.g. if you have a variable like `DayOfWeek` day then you cannot assign it value from `DayOfMonth` enum.

**26) How does Autoboxing of Integer work in Java? (**[**answer**](http://javarevisited.blogspot.sg/2012/07/auto-boxing-and-unboxing-in-java-be.html#axzz59AWpr6cb)**)**
hint: By using the `valueOf()` method in Java.

**27) Difference between** `**PATH**` **and** `**Classpath**` **in Java? (**[**answer**](http://www.java67.com/2012/08/what-is-path-and-classpath-in-java-difference.html)**)**
hint: `PATH` is used by the operating system while `Classpath` is used by JVM to locate Java binary, e.g. JAR files or Class files. See[**Java Fundamentals: The Core Platform**](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fjava-fundamentals-core-platform) to learn more about `PATH`, `Classpath`, and other Java environment variable.

[![](https://miro.medium.com/max/478/1*PBuMgGmVXwBguv-SPw7YJw.jpeg)](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fjava-fundamentals-core-platform)

**28) Difference between method overloading and overriding in Java? (**[**answer**](http://www.java67.com/2015/08/top-10-method-overloading-overriding-interview-questions-answers-java.html)**)**
hint: Overriding happens at subclass while overloading happens in the same class. Also, overriding is a runtime activity while overloading is resolved at compile time.

**29) How do you prevent a class from being sub-classed in Java? (**[**answer**](http://www.java67.com/2017/06/10-points-about-final-modifier-in-java.html)**)**\
hint: just make its constructor private

**30) How do you restrict your class from being used by your client? (**[**answer**](http://javarevisited.blogspot.sg/2016/01/why-jpa-entity-or-hibernate-persistence-should-not-be-final-in-java.html)**)**\
hint: make the constructor private or throw an exception from the constructor

**31) Difference between** `**StringBuilder**` **and** `**StringBuffer**` **in Java? (**[**answer**](http://www.java67.com/2016/10/5-difference-between-stringbuffer.html)**)**
hint: `StringBuilder` is not synchronized while `StringBuffer` is synchronized.

**32) Difference between Polymorphism and Inheritance in Java? (**[**answer**](http://www.java67.com/2014/04/difference-between-polymorphism-and-Inheritance-java-oops.html)**)**
hint: Inheritance allows code reuse and builds the relationship between class, which is required by Polymorphism, which provides dynamic behavior. See [**Object Oriented Java Programming: Data Structures and Beyond Specialization**](
https://coursera.pxf.io/c/3294490/1164545/14726?u=https%3A%2F%2Fwww.coursera.org%2Fspecializations%2Fjava-object-oriented) on Coursera, to learn more about OOP features. One of the most in-depth course for beginners. 

[![](https://thepracticaldev.s3.amazonaws.com/i/vuohxotp8qeh638lzjpr.png)](
https://coursera.pxf.io/c/3294490/1164545/14726?u=https%3A%2F%2Fwww.coursera.org%2Fspecializations%2Fjava-object-oriented)

By the way, if you find Coursera courses useful, which they are because they are created by reputed companies and universities around the world, I suggest you join the [**Coursera Plus**](https://coursera.pxf.io/c/3294490/1164545/14726?u=https%3A%2F%2Fwww.coursera.org%2Fcourseraplus), a subscription plan from Coursera which gives you unlimited access to their most popular courses, specialization, professional certificate, and guided projects. It cost around $399/year but its complete worth of your money as you get unlimited certificates.


**33) Can we override static method in Java? (**[**answer**](http://www.java67.com/2012/08/can-we-override-static-method-in-java.html)**)**\
hint: No, because overriding resolves at runtime while static method call is resolved at compile time.

**34) Can we access the private method in Java? (**[**answer**](http://www.java67.com/2012/08/can-we-override-private-method-in-java.html)**)**\
hint: yes, in the same class but not outside the class

**35) Difference between interface and abstract class in Java? (**[**answer**](http://www.java67.com/2017/08/difference-between-abstract-class-and-interface-in-java8.html)**)**
hint: from [Java 8](https://dzone.com/articles/5-courses-to-crack-java-certification-ocajp-1z0-80), the difference is blurred. However, a Java class can still implement multiple interfaces but can only extend one class.

**36) Difference between DOM and SAX parser in Java? (**[**answer**](http://www.java67.com/2012/09/dom-vs-sax-parser-in-java-xml-parsing.html)**)**\
hint: DOM loads whole XML File in memory while SAX doesn't. It is an event-based parser and can be used to parse a large file, but DOM is fast and should be preferred for small files.

**37) Difference between throw and throws keyword in Java? (**[**answer**](http://www.java67.com/2012/10/difference-between-throw-vs-throws-in.html)**)**\
hint: throws declare what exception a method can throw in case of error but throw keyword actually throws an exception. See [**Java Fundamentals: Exception Handling**](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fjava-fundamentals-exception-handling) to learn more about Exception handling in Java.

[![](https://miro.medium.com/max/875/1*O5DEoN9mOy3D0HxFKWwfKQ.png)](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fjava-fundamentals-exception-handling)

**38) Difference between fail-safe and fail-fast iterators in Java? (**[**answer**](http://www.java67.com/2015/06/what-is-fail-safe-and-fail-fast-iterator-in-java.html)**)**
hint: fail-safe doesn't throw `ConcurrentModificationException` while `fail-fast` does whenever they detect an outside change on the underlying collection while iterating over it.

**39) Difference between Iterator and Enumeration in Java? (**[**answer**](http://javarevisited.blogspot.sg/2010/10/what-is-difference-between-enumeration.html#axzz59AWpr6cb)**)**
hint: Iterator also gives you the ability to remove an element while iterating while Enumeration doesn't allow that.

**40) What is** `**IdentityHashMap**` **in Java? (**[**answer**](http://www.java67.com/2016/09/difference-between-identityhashmap-weakhashmap-enummap-in-java.html)**)**
hint: A `Map`, which uses the `==` equality operator to check equality instead of the `equals()` method.

**41) What is the** `**String**` **pool in Java? (**[**answer**](http://javarevisited.blogspot.sg/2016/07/difference-in-string-pool-between-java6-java7.html#axzz4pGGwsyna)**)**
hint: A pool of `String` literals. Remember it's moved to heap from perm gen space in JDK 7.

**42) Can a** `**Serializable**` **class contains a non-serializable field in Java? (**[**answer**](http://javarevisited.blogspot.sg/2016/09/how-to-serialize-object-in-java-serialization-example.html)**)
**hint: Yes, but you need to make it either static or transient.

**43) Difference between this and super in Java? (**[**answer**](http://www.java67.com/2013/06/difference-between-this-and-super-keyword-java.html)**)**
hint: this refers to the current instance while super refers to an instance of the superclass.

**44) Difference between** `**Comparator**` **and** `**Comparable**` **in Java? (**[**answer**](http://www.java67.com/2013/08/difference-between-comparator-and-comparable-in-java-interface-sorting.html)**)**\
hint: `Comparator` defines custom ordering while `Comparable` defines the natural order of objects, e.g. the alphabetic order for `String`. See[**The Complete Java MasterClass**](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fjava-the-complete-java-developer-course%2F) to learn more about sorting in Java.

[![](https://miro.medium.com/max/875/1*MTR8OytpiIMidLndBnsJ5g.png)](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fjava-the-complete-java-developer-course%2F)

**45) Difference between** `**java.util.Date**` **and** `**java.sql.Date**` **in Java? (**[**answer**](http://javarevisited.blogspot.sg/2012/04/difference-between-javautildate-and.html)**)**
hint: former contains both date and time while later contains only date part.

**46) Why wait and notify method are declared in** `**Object**` **class in Java? (**[**answer**](http://javarevisited.blogspot.sg/2012/02/why-wait-notify-and-notifyall-is.html)**)**
hint: because they require lock which is only available to an object.

**47) Why Java doesn't support multiple inheritances? (**[**answer**](http://javarevisited.blogspot.sg/2011/07/why-multiple-inheritances-are-not.html)**)**
hint: It doesn't support because of a bad experience with C++, but with Java 8, it does in some sense --- only multiple inheritances of `Type` are not supported in Java now.

**48) Difference between checked and unchecked Exception in Java? (**[**answer**](http://javarevisited.blogspot.sg/2011/12/checked-vs-unchecked-exception-in-java.html)**)**
hint: In case of checked, you must handle exception using catch block, while in case of unchecked, it's up to you; compile will not bother you.

**49) Difference between Error and Exception in Java? (**[**answer**](http://www.java67.com/2012/12/difference-between-error-vs-exception.html)**)**
hint: I am tired of typing please check the answer

**50) Difference between Race condition and Deadlock in Java? (**[**answer**](http://javarevisited.blogspot.sg/2012/02/what-is-race-condition-in.html#axzz59AbkWuk9)**)**
hint: both are errors that occur in a concurrent application, one occurs because of thread scheduling while others occur because of poor coding. See [Multithreading and Parallel Computing in Java](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fmultithreading-and-parallel-computing-in-java%2F) to learn more about deadlock, Race Conditions, and other multithreading issues.


Additional Resources
--------------------

-   [Java Interview Guide: 200+ Interview Questions and Answers](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fjava-interview-questions-and-answers%2F)
-   [Spring Framework Interview Guide --- 200+ Questions & Answers](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fspring-interview-questions-and-answers%2F)
-   [Preparing For a Job Interview By John Sonmez](https://pluralsight.pxf.io/c/1193463/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fdeveloper-job-interviews)
-   [Java Programming Interview Exposed by Markham](http://www.amazon.com/Java-Programming-Interviews-Exposed-Markham/dp/1118722868?tag=javamysqlanta-20)
-   [Cracking the Coding Interview --- 189 Questions and Answers](http://www.amazon.com/Cracking-Coding-Interview-6th-Edition/dp/0984782850/?tag=javamysqlanta-20)
-   [Data Structure and Algorithms Analysis for Job Interviews](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fdata-structure-and-algorithms-analysis%2F)
-   [130+ Java Interview Questions of Last 5 Years](http://javarevisited.blogspot.sg/2015/10/133-java-interview-questions-answers-from-last-5-years.html)
- [Grokking the Java Interview - FREE Sample PDF](https://javinpaul.gumroad.com/l/HMOAv)
- [Grokking the Spring Boot Interview - FREE Sample PDF](https://javinpaul.gumroad.com/l/grokking-springboot-interview-sample)


### Closing Notes
Thanks, You made it to the end of the article ... Good luck with your programming interview! It's certainly not going to be easy, but these questions will certainly help you. It will also encourage you to learn more. 

If you like this article, then please share with your friends and colleagues, and don't forget to follow [javinpaul](https://twitter.com/javinpaul) on Twitter!


> **P.S. ---** If you need some FREE resources to learn Java, you can check out this list of [**my favorite free Java courses**](https://medium.com/javarevisited/10-free-courses-to-learn-java-in-2019-22d1f33a3915) to start your preparation.
>
> **P. S. S. ---** I have not provided the answer to the interview questions shared in the image " How many String objects are created in the code?" can you guess and explain?

And, If you are preparing for Java interviews this year you can also get my **[Java + Spring Interview + SQL Bundle on Gumroad](https://javinpaul.gumroad.com/l/sowpfg)**, use code **friends20** to get a 20% discount also