Ramp 2026 OA |CodeSignal real question analysis + 4 coding question ideas restoration + efficient passing guide

48 Views
No Comment

I just put Ramp after finishing the 2026 OA, while the memory is still fresh, let me give you a complete review. This written test was completed on CodeSignal, with a total of 90 minutes and 4 lines of coding. The whole process required camera proctoring, and no pauses were allowed in the middle. The overall pace was quite tight. If it is your first time to do this kind of OA with 4 consecutive questions + strong proctoring, the pressure will be significantly greater than ordinary HackerRank.

Ramp 2026 OA |CodeSignal real question analysis + 4 coding question ideas restoration + efficient passing guide

Level 1

Cloud storage systems need to support file operations:

  • Add_file(self, name: str, size: int) -> bool: Adds a file named Name New file,Size Is the number of bytes of memory required for the file. If the file with the same name already exists, the operation fails. File added successfully returns True, otherwise return False.
  • Get_file_size(self, name: str) -> int | None: If file Name If it exists, return its size, otherwise return None.
  • Delete_file(self, name: str) -> int | None: Delete files Name. If the deletion is successful, the size of the deleted file will be returned. If the file does not exist, it will be returned. None.

Problem-solving ideas:

Level 1 requires you to maintain a mapping of file name -> file size. It needs to support addition and deletion checks, and return bool or None as required. Just use a hash table to manage the status, and clearly determine the two boundary conditions of repeated additions and deletions.

Level 2

Implement an operation that retrieves statistics for files with a specific prefix:

  • Get_n_largest(self, prefix: str, n: int) -> list[str]: Returns the name to Prefix Before the beginning N List of largest files in the format ["()", ..., "()"].
    • Files are sorted in descending order by size; if they are the same size, they are sorted in ascending dictionary order by file name.
    • If there are no files that meet the criteria, an empty list is returned; if the number of files that meet the criteria is less than N, all files that meet the criteria are returned.

Problem-solving ideas:

There is a new feature that requires you to search for the top n largest files. That is to do prefix filtering on existing files, and then take out the top n largest files. Sort by size in descending order and file name in ascending order. Just sift directly in the hash table we saved, sort again, and finally return a string according to the specified format.

Level 3

To achieve multi-user support, all users share the same file system, but each user has a storage capacity limit:

  • Add_user(self, user_id: str, capacity: int) -> bool:Add a new user,Capacity Is the upper limit of its storage capacity (bytes). Like User_id If it already exists, the operation will fail. Successful creation returns True, otherwise return False.
  • Add_file_by(self, user_id: str, name: str, size: int) -> int | None:Function and Level 1 Add_file Consistent, but the file belongs to User_id All. If adding it will exceed the user capacity limit, it cannot be added. If the addition is successful, the remaining capacity of the user will be returned, otherwise it will be returned. None.
    • Note: Level 1 Medium Add_file The operation defaults to User_id = "admin" Execution, admin has unlimited storage capacity.
  • Merge_user(self, user_id_1: str, user_id_2: str) -> int | None:Will User_id_2 Accounts merged into User_id_1.User_id_2 Ownership of all files is transferred to User_id_1, the remaining capacity is also added to User_id_1 Within the capacity limit. After successful merger User_id_2 Deleted, returned User_id_1 The remaining capacity after the merger; if any user does not exist, it will be returned None.

Problem-solving ideas:

It is necessary to add user-dimensional capacity management and account merging logic on the basis of the global file system. We can use multiple hash tables for hierarchical maintenance: a global hash table records the ownership and size of all files, and then a user-specific hash table records the used capacity and total capacity limit of each user. When adding a user, check whether the ID is duplicated; when adding a file, verify whether the user capacity is sufficient, and only write and update the remaining capacity if the conditions are met; when merging accounts, transfer the file ownership of the merged user, accumulate the capacity, and finally delete the merged user, ensuring the consistency of the file status and user capacity data throughout the process.

Level 4

Implement user file backup function:

  • Backup_user(self, user_id: str) -> int | None: backup User_id The current state (file name and size) of all files, backups are stored in a separate system and are not affected by subsequent file operations. If the user already has a backup, it will be overwritten. Returns the number of backup files if the backup is successful, or returns if the user does not exist. None.
  • Restore_user(self, user_id: str) -> int | None:Will User_id The file status is restored to the most recent backup. If it has never been backed up, all files of the user will be deleted. If it cannot be restored because another user already has a file with the same name, the file will be ignored. Returns the number of recovered files if the recovery is successful, or returns if the user does not exist. None.
    • Notice:Merge_user Does not affect User_id_1 Backup,User_id_2 And its backups will be deleted.
    • Notice:Restore_user The operation does not affect the user's capacity limit.

Problem-solving ideas:

Adding backup and recovery functions on top of Level 3 requires additional maintenance of independent storage for user backup snapshots. When backing up, the status (name and size) of all the user's current files are saved as snapshots, overwriting old backups; when restoring, the user's current files are first cleared, and then the snapshots are traversed one by one to try to restore. When encountering globally existing files with the same name, they are skipped. Finally, the number of successfully restored files is counted, while ensuring that the backup data is not affected by subsequent operations, and the restore operation does not change the user's capacity limit.

About how to survive Ramp OA

Ramp OA is tight on time, has many hidden cases, and has cameras turned on, so many students are easily stuck. I have helped hundreds of students from all backgrounds get ashore successfully. If you need help, you can go to Programhelp directly. Team members come from Oxford, Princeton, Peking University and Amazon/Google/Alibaba, all OA ghostwriting And CodeSignal test taking are all conducted in person. All test cases pass 100%, full refund if not passed. 24-48 hours expedited, direct docking.

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END
 0