1.Explain the virtual DOM and how React uses it
Answer
The virtual DOM is React's in-memory tree representation of the UI. On state change React re-renders to a new tree, diffs it against the previous one (reconciliation), and applies only the minimal real-DOM mutations. Keys help it match list items correctly. This batches updates efficiently while letting developers write declarative UI code.