Ramp OA interview experience sharing: three levels of progressive examination, do not underestimate the basic questions

1,043 Views
No Comment

Recently swiped Ramp OA , the overall difficulty is considered moderate, mainly to implement a simplified version of the Cloud Storage System, in three levels of difficulty, with each level progressing, all of them having to implement the complete function within the allotted time. Share the questions and my feelings.

Overview of OA processes

Ramp's OA was done on its own online platform and lasted approximately 90 minutes.The topic is not a simple LeetCode, but more like a simplified implementation of a system design. From file manipulation to statistical queries to multi-user scenarios, the difficulty increases layer by layer.

Content of real questions

Level 1

The cloud storage system should support file manipulation.

  • add_file(self, name: str, size: int) -> bool - should add a new file name to the storage. size is the amount of memory required in bytes. the current operation fails if a file with the same The current operation fails if a file with the same name already exists. returns True if the file was added successfully or False otherwise.
  • get_file_size(self, name: str) -> int | None - should return the size of the file name if it exists, or None otherwise.
  • delete_file(self, name: str) -> int | None - should delete the file name. Returns the deleted file size if the deletion was successful or None if the file does not exist.

Examples

add_file("/dir1/dir2/file.txt", 10) → True
add_file("/dir1/dir2/file.txt", 5) → False
get_file_size("/dir1/dir2/file.txt") → 10
delete_file("/non-existing.file") → None
delete_file("/dir1/dir2/file.txt") → 10
get_file_size("/not-existing.file") → None

Level 2

Implement an operation for retrieving some statistics about files with a specific prefix.

  • get_n_largest(self, prefix: str, n: int) -> list[str] - should return the list of strings representing the names of the top n largest files with names starting with prefix in the following format. ["()", ... , "()"].

Sorting rules.

  1. By size (descending)
  2. If tie → lexicographical order

Examples

add_file("/dir/file1.txt", 5) → True
add_file("/dir/file2", 20) → True
add_file("/dir/deeper/file3.mov", 9) → True
get_n_largest("/dir", 2) → ["/dir/file2(20)", "/dir/deeper/file3.mov(9)"]
get_n_largest("/dir/file", 3) → ["/dir/file2(20)", "/dir/file1.txt(5)"]
add_file("/another_dir", "file.txt") → None (invalid input)
add_file("/big_file.mp4", 20) → True
get_n_largest("/", 2) → ["/big_file.mp4(20)", "/dir/file2(20)"]

Level 3

Implement support for queries from different users.

  • add_user(self, user_id: str, capacity: int) -> bool - Add new user with storage limit. fail if user already exists.
  • add_file_by(self, user_id: str, name: str, size: int) -> int | None - similar to add_file, but restricted by user's remaining capacity. return remaining capacity if success, None otherwise.
  • merge_user(self, user_id_1: str, user_id_2: str) -> int | None - merge user2 into user1: transfer files and add remaining capacity. Delete user2 after merge.

⚠️ Note: All queries calling the add_file from Level 1 are run by "admin" who has unlimited storage.

My Experience

Ramp OA is not just an algorithmic question, it's more of a code design question:

  • Level 1 Basic, the main test is whether you can clean code.
  • Level 2 begins to look at sorting + data structure selection, to ensure complexity.
  • Level 3 is more system design oriented and requires consideration of multi-user restrictions, storage management, and merge logic.

Personally, I think the hard part is Designing the data structure, at the beginning, you have to choose whether to nest the dictionary, or class storage, otherwise it will be very troublesome to add the function later.

You're one step away from an Offer & Programhelp

This time, I was able to get through the Ramp OA because I had brushed up on similar questions in advance. If you are about to face Ramp or similar OA, and want to be faster and more stable, you can actually consider Programhelp.

The team has Amazon, Google engineers and Oxford and Tsinghua seniors, providing services such as OA ghostwriting, untraceable online help, VO real-time tips, and interview simulation. The efficiency and pass rate will be much higher than brushing the questions alone.

Contact us and let us help you get OA together and take the ideal opportunity!

author avatar
jor jor
END
 0
Comment(No Comment)