Back to problems

Design an In-Memory Object Manager with TTL

Object-Oriented Programming · Airbnb · Medium

Approach: Nested Hash Maps with Explicit Observation Time Intuition and semantics The object manager can be built from two nested hash maps: the outer map keyed by object_id, and each inner map keyed by a field name within that object. To support TTLs, each field entry stores not only its value but also the time interval in which that value is valid. The original problem does not say what time an untimed get or prefix scan should observe once timed writes exist. We resolve…

Checking your access…