Xoriant interview question

React Routing Javascript problem scenario