Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Cloud Price Estimation System

Let sales reps and analysts price a corporate customer's projected cloud usage under up to five discount strategies, compare them side by side, and reopen a saved estimate with exactly the same numbers.

Problem statement

Design a price estimation system for a cloud provider. Sales reps and analysts use it to try different discount strategies for a corporate customer before the provider offers that customer a discount.

The data it starts from. - For this exercise, assume the provider's price list is made of price entries. A price entry is the price of one kind of usage of one service in one region, for example one hour of a certain virtual machine size, or one GB of storage kept for a month. - Assume many price entries have volume tiers: within a month, a customer's first units cost one price and further units cost less. All prices are in US dollars. - Assume the billing system already records every customer's actual usage. This system can read that data but does not own it. An estimate starts from the customer's billed usage over the last 12 months, called the usage baseline. - Assume list prices stay as they are on the day of the estimate for the whole contract term.

What a user does. - A user picks a customer and a contract term of 1 to 3 years, and may add an expected yearly growth rate per service (for example, storage grows 30% a year). - The user defines up to 5 discount strategies to compare. Assume three kinds: 1. A percent off everything. 2. A percent off chosen services only. 3. A spend commitment: the customer promises to spend at least a set amount in each contract year and gets a percent off everything. If its discounted spend in a year is below that amount, it still pays the committed amount. - Discounts apply to the list price after volume tiers. The commitment is checked once per contract year. - For each strategy, the system shows the total at list price, the total after the discount, the discount amount and the effective discount rate (the discount amount divided by the list-price total), broken down per service and per year. - The user saves the scenario (the customer, term, growth rates and strategies, with their results) to share it or reopen it later. A rep and an analyst may both work on the same scenario.

Out of scope. - Approving the discount, signing the contract and billing the customer. - Taxes, credits and currency conversion. - A price calculator for customers.

What to build

  1. A user picks a customer and gets its usage baseline from billed usage, then sets a contract term of 1 to 3 years and an optional yearly growth rate per service.
  2. The system prices the projected usage at list price, with volume tiers, and then under each of up to 5 discount strategies: a percent off everything, a percent off chosen services, or a yearly spend commitment with a percent off.
  3. For each strategy, the user sees the list-price total, the discounted total, the discount amount and the effective discount rate, per service and per year, side by side.
  4. A user saves a scenario, and anyone with access can reopen it later and see exactly the same numbers. Moving it to newer prices or usage creates a new revision (a new saved version), and the old one stays.

At scale

  • For this exercise, assume the price list has about 1,000,000 price entries. A new version of the price list comes out a few times a week and usually changes the prices of only a few services.
  • For this exercise, assume about 100,000 corporate customers. A typical customer uses about 2,000 price entries in a month, and the largest use about 50,000. Rolled up per customer, price entry and month, that is about 200 million rows a month, and monthly usage is kept for 3 years (about 7 billion rows).
  • For this exercise, assume about 3,000 sales reps and analysts, who run up to 1,000 estimates an hour near the end of a quarter. A typical estimate (up to 5 strategies over 3 years) must come back within 5 seconds. For the largest customers, an estimate may take up to 1 minute if the user sees its progress.
  • For this exercise, assume a saved scenario must show the same numbers, to the cent, every time it is opened, for 5 years. Replaying a past month at list price must come within 1% of the list-price charges on the customer's real bill for that month, before discounts, taxes and credits.