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,909 java developer interview questions shared by candidates

Then there was software development problem, to write down Java application, 1 file, not more than 50 lines of code, which read given file (63kb) of text, find all words there and print list of words with number of their occurences. This programm should work less than 100ms.
avatar

Software Engineer (Java)

Interviewed at Scandium

1
Apr 16, 2015

Then there was software development problem, to write down Java application, 1 file, not more than 50 lines of code, which read given file (63kb) of text, find all words there and print list of words with number of their occurences. This programm should work less than 100ms.

PART 2 on glassdoor phase 3 java question Java program will focus on string and string only where you have to manipulate a given string Here you have to make logics with use of IF/Else+WhileLOOP+FORLOOP+Switch you cannot use pre defined methods from java classes compiler is little different this will not run >>>>> XXXXXXXXXX(((((( public class RegexMatches { public static void main( String args[] ){ // String to be scanned to find the pattern. String line = "This order was placed for QT3000! OK?"; String pattern = "(.*)(\\d+)(.*)"; // Create a Pattern object Pattern r = Pattern.compile(pattern); // Now create matcher object. Matcher m = r.matcher(line); if (m.find( )) { System.out.println("Found value: " + m.group(0) ); System.out.println("Found value: " + m.group(1) ); System.out.println("Found value: " + m.group(2) ); } else { System.out.println("NO MATCH");}}} ))))))XXXXXXXXXX you cannot apply this compiler will create error will not compile compiler is not up to date and cause many error in a small screen which is hard to read SOOOOOO you have to >>>>> You have to focus on logics logics and logics only This type of program will run this will run >>>>>>>>> Program to convert a string (“heLLowW”) into (“Helloww”) class go{ static void opp(String string){ int i=0; char a=string.charAt(i); if(a>=97&&a<=122) { a=(char)(a-32); } System.out.print("aaa="+a); i++; for(;i<string.length();i++) {a=string.charAt(i); if(a>=65&&a<=90) {a=(char)(a+32); }System.out.print(a); }}}public class Procase { public static void main(String[] args) { go g=new go(); g.opp("heLLowW");}} another example to convert a string into lower case class puffy{ static void opp(String string){ int i=0; for(;i<string.length();i++){ char x=string.charAt(i); if(x==32){ x=66; }if(x>=65&&x<=90){ x=(char)(x+32); } System.out.print(x);}} } public class lowcase { public static void main(String[] args) { puffy pf=new puffy(); pf.opp("helJSakdaS adcjadcAAV"); }} Another example To find substring class paoo{ static void pao(String str){ int length=str.length(); for(int c=0;c<length;c++){ for(int i=0;i<=length;i++){ String sub=str.substring(c, c+i); System.out.println(sub); }}}} public class substring { public static void main(String[] args) { paoo p= new paoo(); p.pao("fun");}} another program to convert a number from decimal to binary public class NewClass2 { public static void main(String[] args) { int a=2334466; String binary=""; while(a>0){ int rem=a%2; binary=rem+binary; a=a/2; } System.out.println("answer is ="+binary);}} You will pass this round if u make query Java program result 0 1 fail 0 2 Fail(its 40% but still fail) 1 0 fail 1 2 pass 2 2 pass 3 0 pass That’s all in this round
avatar

Java Developer

Interviewed at InnoEye Technologies

3.3
Jun 9, 2015

PART 2 on glassdoor phase 3 java question Java program will focus on string and string only where you have to manipulate a given string Here you have to make logics with use of IF/Else+WhileLOOP+FORLOOP+Switch you cannot use pre defined methods from java classes compiler is little different this will not run >>>>> XXXXXXXXXX(((((( public class RegexMatches { public static void main( String args[] ){ // String to be scanned to find the pattern. String line = "This order was placed for QT3000! OK?"; String pattern = "(.*)(\\d+)(.*)"; // Create a Pattern object Pattern r = Pattern.compile(pattern); // Now create matcher object. Matcher m = r.matcher(line); if (m.find( )) { System.out.println("Found value: " + m.group(0) ); System.out.println("Found value: " + m.group(1) ); System.out.println("Found value: " + m.group(2) ); } else { System.out.println("NO MATCH");}}} ))))))XXXXXXXXXX you cannot apply this compiler will create error will not compile compiler is not up to date and cause many error in a small screen which is hard to read SOOOOOO you have to >>>>> You have to focus on logics logics and logics only This type of program will run this will run >>>>>>>>> Program to convert a string (“heLLowW”) into (“Helloww”) class go{ static void opp(String string){ int i=0; char a=string.charAt(i); if(a>=97&&a<=122) { a=(char)(a-32); } System.out.print("aaa="+a); i++; for(;i<string.length();i++) {a=string.charAt(i); if(a>=65&&a<=90) {a=(char)(a+32); }System.out.print(a); }}}public class Procase { public static void main(String[] args) { go g=new go(); g.opp("heLLowW");}} another example to convert a string into lower case class puffy{ static void opp(String string){ int i=0; for(;i<string.length();i++){ char x=string.charAt(i); if(x==32){ x=66; }if(x>=65&&x<=90){ x=(char)(x+32); } System.out.print(x);}} } public class lowcase { public static void main(String[] args) { puffy pf=new puffy(); pf.opp("helJSakdaS adcjadcAAV"); }} Another example To find substring class paoo{ static void pao(String str){ int length=str.length(); for(int c=0;c<length;c++){ for(int i=0;i<=length;i++){ String sub=str.substring(c, c+i); System.out.println(sub); }}}} public class substring { public static void main(String[] args) { paoo p= new paoo(); p.pao("fun");}} another program to convert a number from decimal to binary public class NewClass2 { public static void main(String[] args) { int a=2334466; String binary=""; while(a>0){ int rem=a%2; binary=rem+binary; a=a/2; } System.out.println("answer is ="+binary);}} You will pass this round if u make query Java program result 0 1 fail 0 2 Fail(its 40% but still fail) 1 0 fail 1 2 pass 2 2 pass 3 0 pass That’s all in this round

Viewing 2831 - 2840 interview questions

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