Gth Software interview question

Please open JSFiddle and share your screen