Cognizant Interview Question

How events loops are working