Algorithm · Databricks · Hard
Requirements Model the file system as a tree containing two kinds of nodes: A DirectoryNode stores children, and each child can be either a file or another directory. A FileNode stores an is_encrypted flag. Part 1: Recursively inspect a directory and return (encrypted_count, unencrypted_count) for every file beneath it. Part 2: Encrypt all files that are currently unencrypted using these APIs: encrypt_file(file) takes T_req + T_file time. encrypt_directory(directory)…
Checking your access…