HomebaseWorks

Java: practice, test and prove it

Java fundamentals: OOP, strings and equality, collections, exceptions, static members and basic streams.

FreeNo sign-up to testNo attempts yet

Java screenings for freshers and early-career developers usually mix short theory questions with output-prediction snippets. Expect questions on how objects and references behave, why String is immutable, the difference between == and equals(), which collection to pick, and how exceptions and finally blocks run.

This page lets you practise those exact patterns. Read each snippet slowly, trace it line by line, and only then pick an answer. The lessons below cover the two areas where most candidates lose marks: equality and strings, and inheritance with exceptions.

Benchmark: The pass mark on this site is 80%, and Java is commonly screened for backend, enterprise application and Android developer roles. Requirements vary by employer.

Lessons

Advertisement

Interview prep

Certificate

Free with an accountA PDF with your name, best score and date. Records this site's tests only.

Common questions

Which Java version should I prepare for?

Most screening questions use features that have been stable since Java 8, such as lambdas and streams. Knowing newer additions like var or records helps, but the fundamentals matter far more.

Do I need to memorise the collections API?

No. You should know when to use ArrayList, HashMap and HashSet, what each one guarantees about order and duplicates, and common methods such as add, get, put and contains.

Why are output-prediction questions so common?

They show whether you understand how Java actually runs code rather than just remembering definitions. Interviewers use them to test references, evaluation order and exception flow quickly.