This is a verified interview question from Amazon. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Maximize Rental Revenue" covers key patterns like Other.
"In Amazon EC2, there are n virtual machine (VMs) types, and each type has a limited number of instances available. Each time a VM instance is rented, the customer pays a fee equal to: * the lowest non-zero availability among all VM types + the highest availability among all VM types. There are m customers arriving one by one. Each customer always rents from the VM type that currently has the highest availability. After a rental, the availability of that VM type decreases by 1. The task is to determine the total revenue earned after serving all rental requests.   "
Join thousands of developers practicing for Amazon.