Clear Street Interview Question

Question based on designing an optimal Algorithm and questions around database design