Object-Oriented Programming · Meta · Medium
Approach 1 — Ownership Bookkeeping with Hash Maps (Top‑N by Full Scan) Every requirement in this system reduces to answering three questions quickly: how many bytes does this user still have?, does this file name exist and who owns it?, and which names does this user own?. Three hash-based records cover all of them: remaining maps a user id to free bytes, size_of maps a file name to its byte count, owner_of maps a file name to its user id, and owned_by maps a user id to the…
Checking your access…