Pregunta de entrevista de Bloomberg

Technical Leetcode style design question