HubSpot interview question

How does an API work?