← Questions

Cloud storage with file versions and a trash bin

0
AnthropicCodingLast asked Apr 2024

Build an in-memory file store in levels, each adding operations to the last.

  1. Add a file with a size (adding an existing name stores a new version), read a file's size (its latest version), move a file with all its versions, and list the n largest files under a path prefix, by size and then name.
  2. Read a given version's size, and delete a version permanently; later version numbers shift down, and deleting the only version removes the file.
  3. Delete every file under a prefix into a trash bin, and restore every trashed file under a prefix. A name already in the trash, or already active on restore, is replaced by the incoming file.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding