Pregunta de entrevista de Paintzen

3 JavaScript algorithm questions of various difficulty.