0
0
HLDsystem_design~10 mins

Blob storage (S3, Azure Blob) in HLD - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new bucket in S3.

HLD
s3_client.create_bucket(Bucket=[1])
Drag options to blanks, or click blank then click option'
A"my-new-bucket"
Bbucket_name
Ccreate_bucket
DBucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name without quotes
Using the method name instead of the bucket name
Using the parameter name as the value
2fill in blank
medium

Complete the code to upload a file to Azure Blob Storage.

HLD
blob_client.upload_blob([1], overwrite=True)
Drag options to blanks, or click blank then click option'
Adata
Bfile_path
Ccontainer_name
Dblob_name
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the file path instead of file content
Passing container or blob names instead of data
3fill in blank
hard

Fix the error in the code to list blobs in an Azure container.

HLD
blobs_list = container_client.[1]()
Drag options to blanks, or click blank then click option'
Alist_blob
Bget_blobs
Cget_blob_list
Dlist_blobs
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names that do not exist
Using singular instead of plural method names
4fill in blank
hard

Fill both blanks to configure S3 bucket policy for public read access.

HLD
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "[1]",
    "Principal": "*",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::[2]/*"
  }]
}
Drag options to blanks, or click blank then click option'
AAllow
BDeny
Cmy-public-bucket
Dprivate-bucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Deny' instead of 'Allow' for Effect
Using wrong bucket name in Resource ARN
5fill in blank
hard

Fill all three blanks to generate a presigned URL for an S3 object.

HLD
url = s3_client.generate_presigned_url(
  ClientMethod='[1]',
  Params={'Bucket': '[2]', 'Key': '[3]'},
  ExpiresIn=3600
)
Drag options to blanks, or click blank then click option'
Aget_object
Bmy-secure-bucket
Cfile.txt
Dput_object
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'put_object' instead of 'get_object' for download URLs
Using incorrect bucket or key names