Two Barrels interview question

Writing test