Slync interview question

Basic coding exercise in any language