Developer Java Interview Questions

30,911 developer java interview questions shared by candidates

Questions asked in interview are very good. We should know why exactly a concept is introduced, what are the advantages of it and why can not we do it in the old way why to use the very concept e.g., What is inheritence, why do we need it. Rather than using inheritence why can't I just create and pass objects of classes. What is Dependency injection? Why do we need it. Why can't we just create beans and inject ourselves? They are basically expecting us to know SOLID principles. Given a class Student with firstname, lastname, ssn. Write a sort method which sorts the list student objects based on firstname and if firstnames are same then consider lastname for those objects and if both firstname and lastname are same then consider ssn for those as sort parameter. (using Comparator) How do we use above class to actually sort the list(They expect you to write this in Java 8 using lambdas Method inference) HashMap related questions (equals() and hashcode()). Time complexity of insertion and retrieval of a value from Hashmap if hashcode() returns constant(same) value all the time. Diff between steam() and parallelStream()? On what kind of objects we can use parallelStream()? How can we write a generic sort method? (Testing our Generics knowledge like <T>, <? extends some Class> How can we achieve encapsulation of certain part of super class code in subclass during inheritance ? What do you know about Inversion of Control? Then they ask about testing / testing frameworks? (Why mocking of data...)
avatar

Java Developer

Interviewed at EPAM Systems

3.9
Jul 26, 2019

Questions asked in interview are very good. We should know why exactly a concept is introduced, what are the advantages of it and why can not we do it in the old way why to use the very concept e.g., What is inheritence, why do we need it. Rather than using inheritence why can't I just create and pass objects of classes. What is Dependency injection? Why do we need it. Why can't we just create beans and inject ourselves? They are basically expecting us to know SOLID principles. Given a class Student with firstname, lastname, ssn. Write a sort method which sorts the list student objects based on firstname and if firstnames are same then consider lastname for those objects and if both firstname and lastname are same then consider ssn for those as sort parameter. (using Comparator) How do we use above class to actually sort the list(They expect you to write this in Java 8 using lambdas Method inference) HashMap related questions (equals() and hashcode()). Time complexity of insertion and retrieval of a value from Hashmap if hashcode() returns constant(same) value all the time. Diff between steam() and parallelStream()? On what kind of objects we can use parallelStream()? How can we write a generic sort method? (Testing our Generics knowledge like <T>, <? extends some Class> How can we achieve encapsulation of certain part of super class code in subclass during inheritance ? What do you know about Inversion of Control? Then they ask about testing / testing frameworks? (Why mocking of data...)

Viewing 3651 - 3660 interview questions

Glassdoor has 30,911 interview questions and reports from Developer java interviews. Prepare for your interview. Get hired. Love your job.