Pulley interview question

Solve an API challenge .