Goto Largest Bucket

Problem Overview

  • Core task: process "goto" and "create" commands across named buckets and return the bucket with the most files after all commands.
  • Inputs/Outputs: an ordered command list; output is the bucket name; constraints: first is goto, at least one create, buckets always exist, no ties, duplicate file names in a bucket are ignored.
  • Context: models a file system with storage buckets and file creation events.
  • From Databricks interviews; a coding interview problem and interview question about command processing.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: