Java solutions to common coding interview questions