Home / Skill tests / Java

Skill test

Java test: 24 questions to check yourself

13,313 open jobs name Java today, with a median advertised pay of $175K. 24 questions from beginner to advanced, about 10 to 15 minutes, the kind that come up in interviews.

In plain words: Java is a programming language used for large business systems, back-end services and Android apps. Answer 24 questions, press the button, and see which you got right, why, and your score by topic.

beginner questions
9
intermediate questions
12
advanced questions
3
take as long as you like
No timer

What the 24 questions cover: Classes (3), Collections (3), Exceptions (3), Types (2), Strings (2), Inheritance (2), Streams (2), Memory (2), Concurrency (2), Basics, Interfaces, Generics. The number in brackets is how many questions a topic has.

1What does the JVM do? Beginner · Basics
2Which of these is a primitive type in Java? Beginner · Types
3How do you check that two strings hold the same text? Beginner · Strings
4What does it mean that a String is immutable? Beginner · Strings
5What is a constructor? Beginner · Classes
6What does static mean on a method? Beginner · Classes
7Where can a private field be used? Beginner · Classes
8Which keyword makes one class a subclass of another? Beginner · Inheritance
9Which collection keeps no duplicate values? Beginner · Collections
10How do ArrayList and LinkedList differ when reading by index? Intermediate · Collections
11You override equals in a class used as a HashMap key. What else must you override? Intermediate · Collections
12What is a key difference between an interface and an abstract class? Intermediate · Interfaces
13What is the difference between overriding and overloading? Intermediate · Inheritance
14What is a checked exception? Intermediate · Exceptions
15When does a finally block run? Intermediate · Exceptions
16What does try-with-resources do? Intermediate · Exceptions
17Why write List<String> rather than a plain List? Intermediate · Generics
18When do filter and map in a Java stream actually run? Intermediate · Streams
19What is Optional for? Intermediate · Streams
20What is autoboxing? Intermediate · Types
21What does the garbage collector do? Intermediate · Memory
22Where do local variables and objects live? Advanced · Memory
23What does synchronized do? Advanced · Concurrency
24What does volatile guarantee on a field? Advanced · Concurrency

Questions

Questions about this test

How do I prepare for a Java interview?
Work through realistic questions, read why each answer is right, then redo the ones you missed. This test has 24, from beginner to advanced, of the kind interviewers commonly ask. Then read the postings: the 13,313 open jobs that name Java show what employers expect on top of it.
Is this Java test free?
Yes. It needs no account and no email, runs in your browser and sends nothing anywhere.
How long does the Java test take, and is there a time limit?
Most people need 10 to 15 minutes for the 24 questions. There is no timer: you can stop, think and come back later in the same tab, and nothing is sent anywhere.
Do I get a certificate for the Java test?
No. It is a practice test for checking yourself before an interview, not an exam, so nobody issues a certificate and nobody sees your score.
What does my score mean?
It is a self-check. 80% or more right means the basics are fresh; half to 80% means a good base with gaps; under half means more practice first. The result also shows your score by topic, so you know what to study. It is not an official certificate.
How can I test my Java skills?
Build a small REST service or command-line tool, write unit tests for it, and use collections, streams and exceptions on purpose. If you can explain why you chose each collection and how your code behaves with several threads, you are ready for most interviews.
Is Java hard to learn?
The basic syntax is regular and well documented, so most people write working programs within weeks. The harder parts are object-oriented design, generics, concurrency and the frameworks used at work, such as Spring.
What is the difference between the JDK, the JRE and the JVM?
The JVM runs bytecode, the JRE is the JVM plus the standard libraries, and the JDK adds the compiler and developer tools. To write Java you install a JDK.
What Java questions come up in interviews?
Most often equals and hashCode, how HashMap works, interfaces against abstract classes, checked and unchecked exceptions, streams, and basic thread safety.

More tests: SQL Excel Python JavaScript Linux Docker React Git Power BI All tests