Test description

This test was designed to check the knowledge and coding skills of Java developers who are up-to-date with the later versions and features in Java. The coding questions evaluate the understanding of both core Java features and also more recent enhancements in the Java language (up to version 17).
Topics: collections, streams, records, immutability, switch expressions, text blocks, sealed classes, pattern matching, executors.

Sample questions

1
What will be the output after the execution of the following code?

Deque<String> moons = new LinkedList<>(); 
moons.offer("Ganymede"); 
moons.offer("Callisto"); 
moons.offer("Europa"); 
moons.poll(); 
moons.poll(); 
System.out.println(moons.peek());