Question 1 of 30
A developer is working on an application that interacts with AWS services using the AWS SDK for Python (Boto3). The application needs to retrieve a list of all S3 buckets owned by the account and then check the size of each bucket to determine if any exceed a specified threshold of 100 GB. The developer writes a function that uses the `list_buckets()` method to retrieve the bucket names and then iterates through each bucket to call the `list_objects_v2()` method to calculate the total size of the objects within each bucket. What is the most efficient way to handle the retrieval of the bucket sizes while minimizing the number of API calls made to AWS?
Use the `head_object()` method to check the size of each object individually within the bucket.
Utilize the `list_objects_v2()` method with the `Summarize` parameter to get the total size of all objects in one call.
Implement a multi-threading approach to call `list_objects_v2()` for each bucket concurrently.
Use the `get_bucket_location()` method to retrieve the bucket's region before checking sizes.

Preparing for Amazon DVA-C02 AWS Certified Developer – Associate (DVA-C02)? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free