Bloomberg interview question

Leetcode style question. System design