Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Detect Unencrypted Buckets and Remediate

MediumPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Detect Unencrypted Buckets and Remediate. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Given a list of paginated API response payloads, each containing storage bucket metadata as JSON-like Python dictionaries, write a function that returns all unencrypted buckets and the remediation actions that should be triggered for them. A bucket is unencrypted if its encryption status is missing, disabled, or explicitly set to a noncompliant value. The output must be deterministic, deduplicated by bucket ID, and sorted by account, region, and bucket name.

Constraints

  • 1 <= len(pages) <= 10^4
  • Each page contains a buckets list, which may be empty
  • 1 <= total number of bucket records across all pages <= 2 * 10^5
  • Bucket IDs are strings and should be used for deduplication
  • Missing encryption or missing enabled means the bucket is noncompliant

Function Signature

def find_unencrypted_buckets(pages):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output