Publicis Sapient interview question

Diff between class and functional component