Skip to content

kevin61225/hw-backend-api-enhancement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Assignment - API Enhancement

Description

Please see the target section down below and try to achieve the items as many as you can.

Target

  1. Import csv file into database, your table MUST have the following columns down below. You can choose any Database service you want. e.g. Amazon RDS, Azure SQL Databae or local SQLite.

    Column Description
    bill/PayerAccountId The account ID of the paying account. For an organization in AWS Organizations, this is the account ID of the master account.
    lineItem/UnblendedCost The UnblendedCost is the UnblendedRate multiplied by the UsageAmount.
    lineItem/UnblendedRate The uncombined rate for specific usage. For line items that have an RI discount applied to them, the UnblendedRate is zero. Line items with an RI discount have a UsageType of Discounted Usage.
    lineItem/UsageAccountId The ID of the account that used this line item. For organizations, this can be either the master account or a member account. You can use this field to track costs or usage by account.
    lineItem/UsageAmount The amount of usage that you incurred during the specified time period. For size-flexible reserved instances, use the reservation/TotalReservedUnits column instead.
    lineItem/UsageStartDate The start date and time for the line item in UTC, inclusive. The format is YYYY-MM-DDTHH:mm:ssZ.
    lineItem/UsageEndDate The end date and time for the corresponding line item in UTC, exclusive. The format is YYYY-MM-DDTHH:mm:ssZ.
    product/ProductName The full name of the AWS service. Use this column to filter AWS usage by AWS service. Sample values: AWS Backup, AWS Config, Amazon Registrar, Amazon Elastic File System, Amazon Elastic Compute Cloud
  2. Create DB index to enhance query performance.

  3. Make APIs to achieve the following requirements

    1. Get lineItem/UnblendedCost grouping by product/productname
      • Input
        Column Required
        lineitem/usageaccountid true
      • Output
          {
              "{product/productname_A}": "sum(lineitem/unblendedcost)",
              "{product/productname_B}": "sum(lineitem/unblendedcost)",
              ...
          }
    2. Get daily lineItem/UsageAmount grouping by product/productname
      • Input
        Column Required
        lineitem/usageaccountid true
      • Output
          {
              "{product/productname_A}": {
                  "YYYY/MM/01": "sum(lineItem/UsageAmount)",
                  "YYYY/MM/02": "sum(lineItem/UsageAmount)",
                  "YYYY/MM/03": "sum(lineItem/UsageAmount)",
                  ...
              },
              "{product/productname_B}": {
                  "YYYY/MM/01": "sum(lineItem/UsageAmount)",
                  "YYYY/MM/02": "sum(lineItem/UsageAmount)",
                  "YYYY/MM/03": "sum(lineItem/UsageAmount)",
                  ...
              },
          }
  4. Your can only use Python or C# to implement APIs.

  5. (Optional) You can add more input arguments to your APIs to achieve paginaton strategy.

  6. (Optional) Use your algorithm to reduce response time when calling the APIs.

Deliverable

  1. Upload codes to your GitHub and provide repo URL.
  2. Include a README.md file in the root of repo.
  3. Provide your API spec, API URLs, and DB schema to README.md.
  4. Use any kind of framework, e.g. ASP.NET 5, Django, Flask.
  5. (Optional) If you are using AWS / Azure / GCP, describe what services you are using.
  6. (Optional) Describe how you reduce the response time / improve performance to README.md.

Notice

  • Once you finished the assignment, send an email back to the one who contacted you.
  • Leave comments to README.md if there is any.

About

An assignment for backend engineer

Resources

Stars

Watchers

Forks

Packages

No packages published