Mutiny Interview Question

It was a typical coding interview question