HubSpot interview question

JavaScript ANSYS, factory function, recursive