Goldman Sachs Interview Question

Few puzzles and design questions