Pregunta de entrevista de Flow Traders

Writing an algorithm, explaining complexity, talking about edge cases, and making it thread safe.