aQb Solutions interview question

How I make optimize api?