Frage im Vorstellungsgespräch bei TradingHub

Binary tree-based pair programming interview, interesting problem. Maths/brainteasers included dynamic programming and coin-flip type questions.