PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Ramp

Design an in-memory cloud storage system

Last updated: Mar 29, 2026

Quick Overview

This question evaluates system design and practical engineering skills for an in-memory file storage library, covering API design, path-indexing data structures for prefix/suffix discovery, per-user capacity accounting, compression semantics, and analysis of time/space complexity.

  • hard
  • Ramp
  • System Design
  • Software Engineer

Design an in-memory cloud storage system

Company: Ramp

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Take-home Project

Design and implement an in-memory cloud storage system that maps fully qualified file paths to file metadata (e.g., name and size). Do not use the real filesystem. Assume requests will not create collisions between file and directory names. Implement the following feature levels (passing earlier levels remains required at later levels): Level 1 — Basic file ops - bool AddFile(const std::string& name, int size): Add a new file path with size in bytes. Fail and return false if a file with the same path already exists. - bool CopyFile(const std::string& name_from, const std::string& name_to): Copy the file at name_from to name_to. Fail if name_from does not exist or is not a file, or if name_to already exists. Return true on success, false otherwise. - std::optional<int> GetFileSize(const std::string& name): Return the file size if the file exists; otherwise return std::nullopt. Level 2 — File discovery - Support finding files by matching path prefixes and by matching suffixes (e.g., extension). Define clear APIs and choose data structures to make these queries efficient. Describe the expected time and space complexity. Level 3 — Users and capacity limits - Add a user concept with per-user storage capacity limits (in bytes). Associate files with users and enforce limits on AddFile/CopyFile. Specify error handling and what each API returns when limits would be exceeded. Level 4 — Compression support - Support compressing and decompressing files. Define APIs to compress/decompress a file and update stored size accordingly. Clarify whether GetFileSize returns logical (uncompressed) size or physical (stored) size, and how capacity accounting works under compression. General requirements - Keep everything in-memory. Provide class and method interfaces, core data structures (e.g., maps/tries/indexes), and justify trade-offs. Concurrency handling is optional but discuss how you would make operations thread-safe if needed. Include a brief test strategy and example scenarios demonstrating the expected behavior.

Quick Answer: This question evaluates system design and practical engineering skills for an in-memory file storage library, covering API design, path-indexing data structures for prefix/suffix discovery, per-user capacity accounting, compression semantics, and analysis of time/space complexity.

Related Interview Questions

  • Design a banking system with payments and merging - Ramp (medium)
  • Count Visits in One Minute - Ramp (hard)
Ramp logo
Ramp
Aug 10, 2025, 12:00 AM
Software Engineer
Take-home Project
System Design
20
0

In-Memory Cloud Storage: Files, Discovery, Users, and Compression

Context: Design an in-memory storage library that maps fully qualified POSIX-style file paths (e.g., "/a/b/c.txt") to file metadata. There is no real filesystem; all data structures are in-memory. Assume requests will not create collisions between file and directory names (e.g., "/a" won't be both a file and a directory).

Requirements

Implement the following feature levels. Each later level must preserve and build on earlier behaviors.

Level 1 — Basic file operations

  • bool AddFile(const std::string& name, int size)
    • Add a new file at path name with size in bytes.
    • Return false if a file with the same path already exists; true otherwise.
  • bool CopyFile(const std::string& name_from, const std::string& name_to)
    • Copy the file at name_from to name_to .
    • Fail if name_from does not exist or is not a file, or if name_to already exists.
    • Return true on success, false otherwise.
  • std::optional <int> GetFileSize(const std::string& name)
    • Return the file size if the file exists; otherwise std::nullopt.

Level 2 — File discovery

  • Support finding files by:
    1. Matching path prefixes (directory-like queries).
    2. Matching suffixes (e.g., extension or arbitrary suffix).
  • Define APIs and choose data structures to make these queries efficient.
  • Describe expected time and space complexity.

Level 3 — Users and capacity limits

  • Add a user concept with per-user storage capacity limits (bytes).
  • Associate files with users and enforce limits on AddFile and CopyFile.
  • Specify error handling and what each API returns when limits would be exceeded.

Level 4 — Compression support

  • Support compressing and decompressing files.
  • Define APIs to compress/decompress a file and update its stored size accordingly.
  • Clarify whether GetFileSize returns logical (uncompressed) size or physical (stored) size, and how capacity accounting works with compression.

General constraints and deliverables

  • Keep everything in-memory. Do not use the OS filesystem.
  • Provide class and method interfaces and the core data structures (e.g., maps/tries/indexes). Justify trade-offs.
  • Concurrency handling is optional, but describe how you would make operations thread-safe.
  • Include a brief test strategy with example scenarios that demonstrate expected behavior.

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Ramp•More Software Engineer•Ramp Software Engineer•Ramp System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.