Interview prep
Java interview questions
Core Java, collections, multithreading, the JVM and Java 8+ features — the questions backend interviews actually ask. Practise free with instant feedback, then test yourself in a timed exam.
Sample Java questions
-
Q1Medium
What does LinkedHashMap accessOrder=true change?
- A It links entries in access order
- B It prevents removals
- C It disables hashing
- D It sorts keys alphabetically
-
Q2Medium
Which Set operation keeps only elements present in both sets?
- A intersectOnly()
- B common()
- C keepBoth()
- D retainAll()
-
Q3Medium
Which method creates a reversed view/order comparator from an existing Comparator?
- A reverseComparatorOnly()
- B reversed()
- C backward()
- D invertSort()
-
Q4Medium
What does Collections.binarySearch require for meaningful results on a list?
- A The list must contain no duplicates
- B The list must be immutable
- C The list must be sorted according to the same ordering
- D The list must be a Set
-
Q5Medium
What is a common safe way to compare two int values in a Comparator?
- A a - b always
- B Integer.compare(a,b)
- C a.equals(b)
- D String.valueOf(a).compareTo(String.valueOf(b))
Answers and explanations appear as you practise — take the free quiz to check yours.
Java courses on IntQues
- Java Collections Deep DiveQuiz · 2,000 questions
- Java Interview PreparationQuiz · 1,990 questions
- Java MultithreadingQuiz · 2,000 questions
- Java StreamsQuiz · 1,997 questions
- ADVANCED JAVAQuiz · 1,997 questions
- Full Stack Java DevelopmentQuiz · 1,896 questions
- Java AdvancedFlashcards · 1,000 cards
- Java Interview PreparationFlashcards · 1,160 cards
- Full Stack Java DevelopmentFlashcards · 883 cards