R3 interview question

implement a solution around a given snippet, or requirnment