Mixmax interview question

Coding interview - coding live in GitHub.