Pregunta de entrevista de Digit Insurance

Basic python codes, design question