Unacademy interview question

How diffing algorithm works in react?