Reported May 2026
Rampdesign

Cloud Storage System, Part 1: File Operations

Reported by candidates from Ramp's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Ramp OA. Under 2s to a working solution.
Founder's read

Ramp reported this one in May 2026, and the first attempt usually dies on a boring detail: the output encoding, not the logic. Cloud Storage System, Part 1 is a design problem. You keep a shared in-memory map of file names to sizes and process rows left to right. Add, get size, delete. That's level 1 of four, and the later levels build on your data structure, so sloppy choices here cost you later. If you blank on the adapter format mid-assessment, StealthCoder runs invisibly as a safety net and shows you the shape of the answer while you keep typing.

The problem

Your task is to implement a simple cloud storage system. All operations that should be supported are listed below.
Solving this task consists of several levels. Subsequent levels are opened when the current level is correctly solved. You always have access to the data for the current and all previous levels.
Requirements
Your task is to implement a simple cloud storage system that maps objects (files) to their metainformation. Specifically, the storage should maintain files and information about them, including each file name and size. This system is in-memory; it does not use the real filesystem.
The levels are cumulative:
Level 1 supports adding, retrieving, and deleting files.
Level 2 displays the largest files matching a prefix.
Level 3 adds capacity-limited users and user merging.
Level 4 backs up and restores a user's files.
To move to the next level, all tests at the current level must pass.
Note
The queries never call operations that produce a collision between a file name and a directory name.
FastPrep Operation-Sequence Adapter
FastPrep calls the function once with operations. Process the rows from left to right while preserving one shared storage state. Every row starts with an uppercase operation name followed by that method's string arguments.
Return one string-array row for every input operation:
Encode a Boolean as ["true"] or ["false"].
Encode an integer as one element, such as ["10"].
Encode None as an empty row [].
Return the formatted list from GET_N_LARGEST directly; an empty list is also [].
Multipart Series
Part 1: File Operations
Part 2: Largest Files
Part 3: Users and Capacity
Part 4: Backup and Restore
Level 1: File Operations
The cloud storage system should support file manipulation.
add_file(self, name: str, size: int) -> bool adds a new file name to the storage. size is the amount of memory required in bytes. The operation fails if a file with the same name already exists. Return True if the file was added successfully or False otherwise. The adapter row is ["ADD_FILE", name, size]. Files added this way are owned by the unlimited admin user.
get_file_size(self, name: str) -> int | None returns the size of file name if it exists, or None otherwise. The adapter row is ["GET_FILE_SIZE", name].
delete_file(self, name: str) -> int | None deletes file name. Return the deleted file size when deletion succeeds, or None if the file does not exist. The adapter row is ["DELETE_FILE", name].

Function
cloudStorageLevel1(operations: String[][]) → String[][]

Examples
Example 1
operations = [["ADD_FILE","/dir1/dir2/file.txt","10"],["ADD_FILE","/dir1/dir2/file.txt","5"],["GET_FILE_SIZE","/dir1/dir2/file.txt"],["DELETE_FILE","/non-existing.file"],["DELETE_FILE","/dir1/dir2/file.txt"],["GET_FILE_SIZE","/not-existing.file"]]
return = [["true"],["false"],["10"],[],["10"],[]]
The first add succeeds, the duplicate add fails, and the existing file size is 10. Deleting a missing file returns None; deleting the existing file returns 10; the final lookup again returns None.

Constraints
Every operation row is well formed and uses an operation available at this level.
Every numeric argument is a base-10 integer string whose value and all arithmetic results fit in a signed 64-bit integer.
File names, prefixes, and user IDs are non-empty case-sensitive strings.
The input never creates a collision between a file name and a directory name.
All users share one global file-name namespace. The admin user exists initially and has unlimited capacity.
Process operations in the supplied order. The storage starts empty.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The core is a hash map from file name to size. add_file checks for the key, returns false on a duplicate, otherwise inserts. get_file_size returns the size or None. delete_file pops the key and returns the old size or None. The trap is the encoding. Booleans become ["true"] or ["false"], integers become a one-element string row, and None becomes an empty row []. Sizes arrive as strings, so parse them to integers on add and stringify on return. Don't return a bare string instead of a list. Also don't treat a duplicate add as an overwrite. Since Ramp's later levels add prefix queries, users and backups, store each file as a small record with name, size and owner, not just a raw int. Owner is admin for now. If you freeze on the dispatch or the row format during the live OA, StealthCoder is the hedge that gets you unstuck fast.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Cloud Storage System, Part 1: File Operations cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Ramp's OA.

Ramp reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Cloud Storage System, Part 1: File Operations FAQ

How hard is Cloud Storage System Part 1 really?+

Easy on logic. It's a dictionary with three operations. The difficulty is reading the adapter spec carefully and getting the string-array output right. Most failures are formatting mistakes, not algorithm mistakes.

What's the trick to level 1?+

Use a hash map keyed by file name. Reject duplicate adds, return the size or an empty row on lookups, and pop on delete. Store records, not bare ints, so later levels can add owners and prefixes without a rewrite.

How do I encode None and booleans?+

None is an empty row []. True is ["true"] and False is ["false"]. Integers are one-element rows like ["10"]. Every input operation must produce exactly one output row, in the same order.

Should I plan for the later levels now?+

Yes, a little. Levels 2 to 4 add largest files by prefix, users with capacity, and backup and restore. Keep a file record with size and owner and keep the dispatch clean. Don't over-build, but don't hardcode a bare map either.

How do I prepare in 48 hours?+

Write a small class with a dict and a dispatch function for operation rows. Practice returning the string-array format. Then sketch how you'd sort files by size and then name for a prefix query, since level 2 is next.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Ramp.

OA at Ramp?
Invisible during screen share
Get it