Cubic Logics interview question

React Basics and js coding