Citadel Securities interview question

2 lc hard oa, pretty time constrained