Oracle interview question

asked to build a react component with proper state management