Algorithm · Coinbase · Hard
Design an in-memory database that stores records by key. Each record maps field names to integer values. Implement the following methods: set(key, field, value) returns None. Create the record if it does not yet exist, then assign value to field. get(key, field) returns the stored integer, or None if either the key or the field is missing. delete(key, field) returns True if the field was present and removed, and False otherwise. When a deletion makes the record empty, remove…
Checking your access…