Top 20 Essential Java Interview Questions with Answers for Freshers with 1 to 2 years Experienced

If you are grad looking for an internship position in a company which uses Java, or a fresher, just out from college and looking out for Java development position, then this post is for you. I have attended, taken and participated in a different level of Java interviews, and I can say there is a huge difference between them, which is not surprising because you obviously want to ask different level questions based upon whether the candidate is fresher or experienced. Similarly, the question at phone interview, written test, and face to face interviews, keeping this in mind, and give you always have a limited amount of time before going for an interview, It's important to prepare right set of questions.

Well, I can't guarantee that you will see questions from this set on your interview but it gives you an idea about the level of questions you can expect in any Java internship or Software trainee positions.

Don't bother about multithreading and complex topic, only basic knowledge of threads is enough. Similarly, put more emphasis on the data structure, algorithms and object-oriented basics like Inheritance, Composition, Encapsulation, Polymorphism etc.

Similarly, Java interviews are not just about Java questions, it is also expected from you that you know computer fundamentals, basics of Linux and SQL, basics of designing a software, coding, networking fundamentals etc.

Once you have good ideas on those topics you are ready for your interview. Though, if you are confused about how to prepare well for all those topics, I can suggest you to two ways, read a book like Cracking the Coding Interview by Gayle Laakmann McDowell, which contains 189 questions and their answers on all these topics.

basic questions for Java programmers



The second way is to join a course like The Coding Interview Bootcamp: Algorithms + Data Structures by Stephen Grider. Though it is not as comprehensive as the Cracking the Coding interview book, it does explain the most important thing algorithms and data structure.

Java fundamentals interview questions


You can also supplement your preparation through courses by joining a couple of others to prepare SQL, Java, Linux etc. I have shared my full list of courses for coding interviews here, which contains some of the best courses to prepare well for programming job interviews.


Java Interview Questions for 1 to 2 years Experienced Programmers

Anyway, let's start with some of the basics Java questions a programmer with 1 to 2 years of experience should know.



1) What's is Polymorphism in Java or OOP? (answer)


2) Given a reference to an abstract class Shape that has an abstract method named Draw, how does Java determine which version of the draw to call? What portion is handled at runtime and what portion at compile time?  (answer)


3) what is the difference between an array and a linked list? How does this affect performance and memory usage? (answer)


4) Describe garbage collection. What do mark and sweep mean? How about generational garbage collection? (answer)


5) what is the difference between a string literal and a string object? (answer)


6) what is the difference between int and Integer? (answer)


7) what is a binary search tree?  How do you implement in Java? (answer)


8) what is a heap memory in Java? (answer)


9) how would you implement a priority queue in Java? (answer)


10) what does "Big O of n" mean in practice? Will an O(n) algorithm always outperform an O(n*n) algorithm? (answer)


Top 20 Java Interview Questions with Answers for Programmers with 1 to 2 years Experience11) What is the difference between a list and a linked list in Java? (answer)


12) What is a map in Java? (answer)


13) what is an array in Java? (answer)


14) What is a thread in Java? (answer)


15) What is a lock in Java? (answer)


16) What is a deadlock? (answer)


17) Difference between Overloading and Overriding? (answer)


18) Difference between abstract class and interface? (answer)


19) Difference between Process and Thread in Java? (answer)


20) Difference between "extends" thread and "implements" Runnable? (answer)


That's all in this list of interview questions for preparing Java internship and Software developer positions. These questions are just to give you an idea of level, which is expected from fresher’s and trainees. Keeping yourself on to a higher level will surely benefit you. Don't forget to share what kind of questions was asked of you in a fresher level interview.


Useful Resources for Preparing Java Interviews
Java Interview Guide: 200+ Interview Questions and Answers
Preparing For a Job Interview By John Sonmez
Spring Framework Interview Guide - 200+ Questions & Answers
Cracking the Coding Interview - 189 Questions and Answers
Java Programming Interview Exposed by Markham
Data Structure and Algorithms Analysis for Job Interviews

Thanks for reading this article so far. If you like this article then please share with your friends and colleagues. If you have any questions or feedback then please drop a note. 

No comments:

Post a Comment