Sample questions implemented in Java.