Pregunta de entrevista de Microsoft

Asked to write code for a low-level design question