Pregunta de entrevista de Notch

Technical questions asked to solve logical program