[ OK ]4ffffcaa-3df8-41f7-af5c-6821240c52f3 — full content available
[ INFO ]category: Coding difficulty: unknown freq: first seen: 2026-02-28
[UNKNOWN][CODING]
$catproblem.md
The Cloud Storage System problem is a common multi-level coding challenge used in Anthropic's Online Assessment (OA). The task is to implement a backend for a simplified cloud storage service that manages objects (files) and their associated metadata. 1
Core Requirements
The problem is typically presented in levels, with each level adding new constraints or operations. You must implement a system that supports the following core operations:
ADD_FILE(file_id, size): Adds a new file to the storage system. If the file_id already exists, it should return an error or update according to the specific level's rules.
GET_FILE_SIZE(file_id): Retrieves the size of a specific file. Returns an error if the file does not exist.
DELETE_FILE(file_id): Removes a file from the system. Often requires returning the size of the deleted file.
Typical Level-Based Progression
As you progress, the complexity increases to test your ability to handle more advanced data management:
Level 1: Basic Storage: Implement the fundamental ADD, GET, and DELETE operations using a basic data structure like a hash map.
Level 2: Capacity Constraints: Introduce a storage limit. You must track the total size of all stored files and reject ADD_FILE requests that exceed the system's capacity.
Level 3: File Copying & Moving: Implement operations like COPY_FILE(source_id, dest_id), which creates a replica of a file.
Level 4: Metadata and Queries: Add support for file metadata (e.g., tags or creation times) and implement a query function to find files based on specific attributes.
Key Performance Indicators (What they look for)
Interviewers at Anthropic prioritize the following qualities in your solution:
Clean Data Modeling: Choosing the right data structures (e.g., dictionaries for 𝑂(1) lookups) to map file_id to its metadata.
Edge Case Handling: Managing scenarios like deleting non-existent files or adding duplicate IDs.
Code Clarity: Using descriptive variable names and writing modular, readable code, even under time pressure.
Complexity Analysis: Being able to explain the time and space complexity of each operation you've implemented. Reddit +2
Would you like me to walk through a Python implementation for one of these specific levels?