Java Developer Interviews

Java Developer Interview Questions

In your interview for a java developer position, be prepared to answer technical questions that test your understanding of Java basics. Interviewers may also ask open-ended questions to assess your coding and problem-solving abilities. Prepare for non-technical questions that focus on time management, interpersonal communication, and work ethic.

Top Java Developer Interview Questions & How to Answer

Question 1

Question #1: What is the difference between HashTable and HashMap in Java?

How to answer
How to answer: Interviewers use technical questions to assess your formal training and understanding of the Java programming language. Use your answer to demonstrate your communication skills. Even if you have been coding for some time, it can be helpful to review Java basics before your interview.
Question 2

Question #2: Write a program to determine if 243 is an Armstrong number.

How to answer
How to answer: Interviewers use open-ended questions to test your coding skills. This question allows the employer to assess your ability to solve a problem using a Java algorithm. Explain your thinking process as you use a code editor or whiteboard to solve the problem.
Question 3

Question #3: How do you produce quality code when you have several Java projects to complete at once?

How to answer
How to answer: Java developers often juggle multiple projects at the same time. Interviewers use questions such as this to test your time management and organizational skills. Employers are also trying to assess your commitment to quality work. If you have experience as a developer, include examples from your work history that demonstrate high-quality work and effective time management.

30,830 java developer interview questions shared by candidates

1. Please consider the HTML below. Assuming it is stored in a String variable, can you write a short Java program to retrieve all the ‘beverages’ from the list shown below. You should assume there could be any number of lists, with any number of items, and in any order, but there will only be one list of beverages. <html> <body> <p>Coders favourite music genre:</p> <ol> <li>House</li> <li>Ballad</li> <li>Dance</li> </ol> <p>Coders favourite beverage:</p> <ol> <li>Coffee</li> ................................................................................ <li>Tea</li> <li>Coke</li> </ol> <p>Coders favourite phrase:</p> <ol> <li>Pfff</li> <li>Damn</li> <li>It works</li> </ol> </body> </html> Consider the following HTML source of the page ‘test.html’ below: <html> <form name="sample" action=”?”> <input type="checkbox" name="field1" /> <input type="hidden" name="field2" id="field_2" /> <input type="radio" name="field3" value="X" /> <input type="radio" name="field3" value="Y" /> <input type="button" oncl1ck="document.getElementById('sample').submit();" value="Submit form" /> <input type=”submit” name=”clicked” value=”Click me” /> </form> </html> 2-Looking at the form above, to which page will the data be sent ? 3-What would be the HTTP method through which the form data will be transmitted ? 4-What will be the value of the checkbox ‘field1’, if the form was submitted as it is ? Hint: the checkbox that is not ticked. 5-What would be the result of clicking the ‘Submit form’ button ? Hint: see the bolded text above, before answering this question.
avatar

Java Developer

Interviewed at Travelfusion

3.3
Feb 17, 2015

1. Please consider the HTML below. Assuming it is stored in a String variable, can you write a short Java program to retrieve all the ‘beverages’ from the list shown below. You should assume there could be any number of lists, with any number of items, and in any order, but there will only be one list of beverages. <html> <body> <p>Coders favourite music genre:</p> <ol> <li>House</li> <li>Ballad</li> <li>Dance</li> </ol> <p>Coders favourite beverage:</p> <ol> <li>Coffee</li> ................................................................................ <li>Tea</li> <li>Coke</li> </ol> <p>Coders favourite phrase:</p> <ol> <li>Pfff</li> <li>Damn</li> <li>It works</li> </ol> </body> </html> Consider the following HTML source of the page ‘test.html’ below: <html> <form name="sample" action=”?”> <input type="checkbox" name="field1" /> <input type="hidden" name="field2" id="field_2" /> <input type="radio" name="field3" value="X" /> <input type="radio" name="field3" value="Y" /> <input type="button" oncl1ck="document.getElementById('sample').submit();" value="Submit form" /> <input type=”submit” name=”clicked” value=”Click me” /> </form> </html> 2-Looking at the form above, to which page will the data be sent ? 3-What would be the HTTP method through which the form data will be transmitted ? 4-What will be the value of the checkbox ‘field1’, if the form was submitted as it is ? Hint: the checkbox that is not ticked. 5-What would be the result of clicking the ‘Submit form’ button ? Hint: see the bolded text above, before answering this question.

"Suppose you have two different kinds of server requests - requests that MUST be responded to in 2 seconds and cannot be resent, and requests that can be responded to in 10 seconds, but can be resent. How would you handle the priority of responding to these requests?"
avatar

Back-end Java Engineer

Interviewed at Fanatics

3.3
May 20, 2016

"Suppose you have two different kinds of server requests - requests that MUST be responded to in 2 seconds and cannot be resent, and requests that can be responded to in 10 seconds, but can be resent. How would you handle the priority of responding to these requests?"

Viewing 311 - 320 interview questions

Glassdoor has 30,830 interview questions and reports from Java developer interviews. Prepare for your interview. Get hired. Love your job.