Princess Cruises Interview Question

How to handle sync and async calls in javascript ?