Reactec interview question

Technical test