Bloomberg interview question

Technical Leetcode style design question