Plum interview question

Two react machine coding questions