1. [OA] Infrastructure as Code — Implement a Terraform module for ByteDance resources
ByteDance requires reusable Terraform modules to streamline resource provisioning across its infrastructure. The task is to create a Terraform module that provisions an AWS S3 bucket with specific configurations.Problem statement: You need to create a Terraform module that provisions an S3 bucket with versioning enabled and lifecycle policies for managing object expiration. Ensure the bucket is public access restricted.Example 1: Input: Module parameters for bucket name and lifecycle policy Output: Terraform code that provisions the S3 bucket as specified Explanation: The output should effectively set up the S3 bucket with the required settings while adhering to AWS best practices.Constraints:
Bucket name must be unique across AWS.
Lifecycle policy must expire objects after 365 days.
Block public access should be enabled.
codingHardci cd#2
2. [OA] Docker Optimization — Optimize the Dockerfile for a ByteDance microservice
ByteDance needs efficient container images to ensure faster deployments and less resource usage in its microservices architecture. Your task is to optimize an existing Dockerfile. You are provided with an initial Dockerfile that is unnecessarily large and slow to build. Your goal is to refactor this Dockerfile to reduce the image size and improve build time.Example 1: Input: Original Dockerfile Output: Optimized Dockerfile Explanation: The optimized file should demonstrate reduced layers and improved caching.Constraints: