Oracle Interview Question

asked to build a react component with proper state management