Amazon·Software Engineer·Online Assessment (OA)
- You have n VM types each with a limited stock count. Customers arrive one by one and always rent from the VM type with the highest current availability. Each rental costs the sum of the current lowest non-zero availability and the highest availability across all VM types. After each rental, that VM type's count drops by 1. Find the total revenue after serving all m customers.
“The revenue formula tripped me up at first.”