Company: Amazon_20sep

Difficulty: medium

Problem Statement

Maximize Hardware Performance Problem Description Amazon is upgrading its network infrastructure and needs to purchase at most two new hardware components to meet the requirement. There are two arrays, expense and performance relating to the n available hardware components. Here expense[i] and performance[i] represent the cost and performance rating of the i th hardware component. Due to procurement limitations, the maximum total expense of the two hardware components is spending_cap . Given two arrays, expense and performance , find the maximum possible performance rating that can be achieved with at most two hardware components whose total expense is less than or equal to spending_cap . Complete the function findMaximumPerformance in the editor below. Function Signature: int findMaximumPerformance(vector<int> expense, vector<int> performance, int spending_cap) Parameters: int expense[n] : the costs of hardware components int performance[n] : the performance ratings int sp

More Amazon_20sep OA questionsInterview experiences