Translate a service name across AWS, Azure, and GCP

Python data engineering interview problem. Difficulty: beginner. Pattern: Dictionaries. About 10 minutes. Free to practice.

Your company is moving from AWS to Google Cloud (GCP). The old migration documents talk about AWS services by name, but the team now works in GCP. Each AWS service has a close GCP twin: for example S3 (file storage) is like Cloud Storage.

Write a function to_gcp(aws_service) that takes the name of an AWS service as a string and returns the name of the matching GCP service. The three names you must translate are: 'S3' becomes 'Cloud Storage', 'MWAA' becomes 'Cloud Composer', and 'Redshift' becomes 'BigQuery'. For any other name, return 'unknown'. Keep the print lines at the bottom of the editor. The grader reads what your code prints.

Requirements

  • Return 'Cloud Storage' for 'S3'.
  • Return 'Cloud Composer' for 'MWAA'.
  • Return 'BigQuery' for 'Redshift'.
  • Return 'unknown' for any other string.

Constraints

  • aws_service is a string that may or may not be one of the three known names.
  • Matching is case-sensitive and exact. There is no fuzzy matching.
  • Keep the print lines, because the grader reads the printed output.

Examples

Input: to_gcp("S3") Output: 'Cloud Storage' This is the expected return value for the given call.

Topics: cloud, vendor-mapping.

More Python interview questions · All interview problems · Learn data engineering

beginner

Translate a service name across AWS, Azure, and GCP

Production ticket: Same job, three brand names - object storage, managed orchestration, and serverless warehouse.

A migration doc references AWS service names. Your team runs GCP. Write `to_gcp(aws_service: str) -> str` that maps: - "S3" -> "Cloud Storage" - "MWAA" -> "Cloud Composer" - "Redshift" -> "BigQuery" Return `"unknown"` for anything else. Keep the prints at the bottom. The grader reads stdout.