Mostrans interview question

React implementation on study case