Back to problems

Cloud Service Usage Cost

Algorithm · Stripe · Easy

You are building the billing logic for a cloud platform. You receive a usage_report (a JSON object) that indicates a target region, and a pricing_table (another JSON object) that holds hourly rates for various services across regions. Your task is to compute the total cost of the reported usage. Here is a sketch of the data shapes: For a single service, the cost is hours × rate where the rate is the one listed for that service in the report's region. If the region named in…

Checking your access…