Publicis Sapient Interview Question

Diff between class and functional component