Pregunta de entrevista de Drawbridge

One coding exercise and design question