SquareShift Interview Question

A medium hard problem solving question, followed by Java core basics.