Jane Street interview question

It was a Design style leetcode question.