Goldman Sachs interview question

Leetcode Style question and System Design