AppDynamics interview question

How is two-way data binding working in Angularjs? How is $watch() and $digest() function implemented in Angularjs?