Back to problems

Implement an In-Memory File Storage System

Object-Oriented Programming · Instacart · Medium

Global Hash Map + Per-User File Tracking The core idea is to keep one hash map from every file path to its metadata. Since paths are unique, this gives expected $$O(1)$$ existence checks, duplicate detection, and size lookups. Each metadata record stores the path, size, and owner. Admin-owned files use a null / None owner, which means they bypass user quota logic entirely. For normal users, a separate hash map stores their capacity, current used space, and a set of paths…

Checking your access…