Pregunta de entrevista de Masabi

Some fairly straghtforward algorithm question, a Java code test and an interview with two managers