Company: Visa associate SW Engineer_4april
Difficulty: medium
Maximize Throughput of a Data Processing Pipeline A data processing pipeline is built from n services wired in series: the output of service i is the input of service i + 1 . Service i currently handles throughput[i] messages per minute. Any service may be scaled up independently, as many times as you can afford. One scaling of service i costs scalingCost[i] , and after being scaled x times that service handles throughput[i] * (1 + x) messages per minute. Because the services run in series, the whole pipeline moves only as many messages per minute as its weakest link: after scaling, the pipeline throughput is the minimum capacity among the n services. You are given throughput , scalingCost and a budget . Choose how many times to scale each service, spending at most budget in total, so that the pipeline throughput is as large as possible. Report that maximum throughput. You do not have to spend the whole budget, and leftover money is simply not used. Function Description Complete the fu